0% found this document useful (0 votes)
14 views24 pages

DBMS Unit 1

The document provides an overview of Database Management Systems (DBMS), including their historical development, key components, and advantages over traditional file systems. It explains concepts such as data, information, and various data models, emphasizing the importance of data abstraction and independence. Additionally, it outlines the differences between file systems and DBMS, highlighting the efficiency, security, and data integrity offered by DBMS.

Uploaded by

tharungoudthanda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views24 pages

DBMS Unit 1

The document provides an overview of Database Management Systems (DBMS), including their historical development, key components, and advantages over traditional file systems. It explains concepts such as data, information, and various data models, emphasizing the importance of data abstraction and independence. Additionally, it outlines the differences between file systems and DBMS, highlighting the efficiency, security, and data integrity offered by DBMS.

Uploaded by

tharungoudthanda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Database Management System

Unit 1
Database System Applications: A Historical Perspective, File Systems versus a DBMS, the Data Model,
Levels of Abstraction in a DBMS, Data Independence, Structure of a DBMS.
Introduction to Database Design: Database Design and ER Diagrams, Entities, Attributes, and Entity Sets,
Relationships and Relationship Sets, Additional Features of the ER Model, Conceptual Design with the ER
Model.

Data:
Data is a real-world entity or an object. Data is a distinct piece of information or facts that need to be
processed. It can be in any form like text, number, picture, measurements, and bytes.

What is Information?
Data becomes information when it is processed, organized, structured, and interpreted in a given context,
turning it into useful and meaningful.

What is a Database?
The database is a collection of inter-related data which is used to retrieve, insert and delete the data
efficiently. It is also used to organize the data in the form of a table, schema, views, and reports, etc.

What is a Database Management System (DBMS)


A Database Management System (DBMS) refers to the technology for creating and managing databases.
DBMS is a software tool to organize (create, retrieve, update, and manage) data in a database
A Database Management System (DBMS) is a software system that allows users to store, manage, and
access data efficiently and effectively. It provides a structured and organized way to store data that can be
easily retrieved and manipulated.
A DBMS typically consists of three main components: a database, a database engine, and a user interface.
The database is where the data is stored, and the database engine is responsible for managing the data and
ensuring its integrity. The user interface provides users with a way to interact with the data, typically through
a query language.
DBMS systems are widely used in various industries and applications, including finance, healthcare,
education, government, and e-commerce. They are essential tools for managing large amounts of data and
ensuring its accuracy, consistency, and security.
Some of the key benefits of using a DBMS include:
1. Data Sharing: A DBMS allows multiple users to access the same data simultaneously, ensuring that
all users have access to the most up-to-date information.
2. Data Security: A DBMS provides various mechanisms to ensure the security of the data, such as
user authentication, access control, and encryption
3. Data Consistency: A DBMS ensures that the data is consistent across all applications and users by
enforcing rules and constraints.
4. Data Integrity: A DBMS provides mechanisms to ensure that the data is accurate and reliable by
enforcing data constraints and performing data validation
5. Data Accessibility: A DBMS provides an efficient and effective way to access and retrieve data,
allowing users to perform complex queries and retrieve specific data quickly and easily.
Overall, a DBMS is an essential tool for managing data in modern organizations, providing efficient,
reliable, and secure access to critical information.

A Historical Perspective
Database Management Systems (DBMS) have been around for several decades, and their history can be
traced back to the early 1960s. In the early days, computer systems were designed to manage data in a
hierarchical or navigational manner, where data was stored in a tree-like structure. This method of storing
data was inefficient and difficult to use, as it required a lot of manual effort to access and manage the data.
In the late 1960s, The first general-purpose DBMS, designed by Charles Bachman, was called
the Integrated Data Store (IDS) which was based on network data model for which he was received
the Turing Award (The most prestigious award which is equivalent to Nobel prize in the field of Computer
Science.).
In the late 1970s, Mr Edgar Codd proposed a new data representation framework called the Relational
Database Model. Mr Edgar Codd won the 1981 Turing Award for his seminal work. This model was based
on the concept of a table, with rows representing individual records and columns representing individual
fields within those records. The relational model allowed for more efficient storage and retrieval of data and
was easier to use than the hierarchical or navigational models.
In the late 1980s IBM developed the Structured Query Language (SQL) for relational databases, as a part
of R project. This system was designed to manage large amounts of data and was used primarily in corporate
and government applications. SQL was adopted by the American National Standards Institute (ANSI) and
International Organization for Standardization (ISO).
In the 1980s, several new DBMS products were introduced, including Oracle, Sybase, and Microsoft SQL
Server. These systems were designed to be more user-friendly and to support more advanced data modeling
and query languages.
In the 1990s, object-oriented DBMS (OODBMS) emerged, which were designed to store and manage
complex data structures, such as multimedia and other types of non-traditional data. These systems were
initially popular in research and academic environments, but their adoption was limited in the commercial
sector.
In the 1991, Microsoft ships MS access, a personal DBMS and that displaces all other personal DBMS
products.
In the 1997, XML applied to database processing. Many vendors begin to integrate XML into DBMS
products.
In the 2000s, web-based applications and cloud computing became more popular, and DBMS systems began
to adapt to these new technologies. New DBMS systems were developed to support distributed and web-
based applications, including NoSQL databases such as MongoDB and Cassandra.
Today, DBMS systems continue to evolve, with an emphasis on scalability, performance, and support for
cloud-based applications. Some of the most popular DBMS systems in use today include Oracle, Microsoft
SQL Server, MySQL, PostgreSQL, and MongoDB.

File Systems v/s DBMS


What is a File system?
A file system is a technique of arranging the files in a storage device like a hard disk, pen drive, DVD, etc. It
helps you to organizes the data and allows easy retrieval of files when they are required. A file system
enables you to handle the way of reading and writing data to the storage medium. It is directly installed into
the computer with the Operating systems such as Windows and Linux.
What is DBMS?
Database Management System (DBMS) is a software for storing and retrieving user’s data while considering
appropriate security measures. It consists of a group of programs that manipulate the database. The DBMS
accepts the request for data from an application and instructs the DBMS engine to provide the specific data.
In large systems, a DBMS helps users and other third-party software to store and retrieve data.
Difference between File System and Database systems

File System Database systems

A file system is a software that manages and DBMS or Database Management System is a
organizes the files in a storage medium. It controls software application. It is used for accessing,
how data is stored and retrieved. creating, and managing databases.

The file system provides the details of data DBMS gives an abstract view of data that hides
representation and storage of data. the details.

Storing and retrieving of data can’t be done DBMS is efficient to use as there are a wide
efficiently in a file system. variety of methods to store and retrieve data.

Data redundancy is more. Data redundancy is less.


File System Database systems

Conventional file systems are used where there is Database systems are used when security
less demand for security constraints (Security is constraints are high (Security is high).
very low).

File systems define the data in un-structured Database systems define the data in a structured
manner. Data is usually in isolated form. manner. Also, there is well defined co-relation
among the data.

Data inconsistency is more in file systems. Data inconsistency is less in database systems.

User locates the physical address of file to access User is unknown to the physical address of the
the data in conventional file systems. data used in database systems.

There is no ability to concurrently access the data There is ability to access the data concurrently
using conventional file system. using database systems.

Not provide support for complicated transactions. Easy to implement complicated transactions.

It doesn’t offer backup and recovery of data if it is DBMS system provides backup and recovery of
lost. data even if it is lost.

Disadvantages of File system


 Each application has its data file so, the same data may have to be recorded and stored many times.
 Data dependence in the file processing system are data-dependent, but, the problem is incompatible
with file format.
 Limited data sharing.
 The problem with security.
 Time-consuming.
 It allows you to maintain the record of the big firm having a large number of items.
 Required lots of labor work to do.
Advantages of DBMS system
 DBMS offers a variety of techniques to store & retrieve data
 Uniform administration procedures for data
 Application programmers never exposed to details of data representation and Storage.
 A DBMS uses various powerful functions to store and retrieve data efficiently.
 Offers Data Integrity and Security.
 The DBMS implies integrity constraints to get a high level of protection against prohibited access to
data.
 Reduced Application Development Time
 Consume lesser space.
 Reduction of redundancy.
 Data independence.

Data Models
A data model is a collection of high-level data description constructs that hide many low-level storage
details. A DBMS allows a user to define the data to be stored in terms of a data model.
The data models can be classified into different categories:

1. Hierarchical Model
Hierarchical Model was the first DBMS model. This model organises the data in the hierarchical tree
structure.
The hierarchy starts from the root which has root data and then it expands in the form of a tree adding child
node to the parent node. This model easily represents some of the real-world relationships like food recipes,
sitemap of a website etc.
Depicts a set of one-to-many (1:M) relationships
Disadvantages of the hierarchical model:
 easy to design at the same time it is quite complex to implement.
 This model also lacks flexibility as the changes in the new tables or segments often yield very
complex system management tasks. Here, a deletion of one segment can lead to the involuntary
deletion of all segments under it.
2. Network Model
This model is an extension of the hierarchical model, the only difference is that a record can have more than
one parent. It replaces the hierarchical tree with a graph.
The network model was created to represent complex data relationships more effectively when compared to
hierarchical models, to improve database performance and standards.
Depicts both one-to-many (1:M) and many-to-many (M: N) relationships.
Disadvantages of the Network Model:
 Database contains a complex array of pointers.
 System complexity limits efficiency.
 Structural changes require changes in all application programs.
 Navigation systems yield complex implementation and management.
 Keep heavy pressure on programmers due to the complex structure.
 Any change like updating, deletion, insertion is very complex.
3. Entity-Relationship Model
An ER model is the logical representation of data as objects and relationships among them. These objects
are known as entities, and relationship is an association among these entities.
Entity-Relationship Model Components
ER diagram basically having three components:
1. Entities − It is a real-world thing which can be a person, place, or even a concept. For Example:
Department, Admin, Courses, Teachers, Students, Building, etc are some of the entities of a School
Management System.
2. Attributes − An entity which contains a real-world property called an attribute. For Example: The
entity employee has the property like employee id, salary, age, etc.
3. Relationship − Relationship tells how two attributes are related. For Example: Employee works for
a department.
An entity has a real-world property called attribute and these attributes are defined by a set of values called
domain.

Advantages of Entity-Relationship Model


 The ER model is easy to build.
 This model is widely used by database designers for communicating their ideas.
 This model can easily convert to any other model like network model, hierarchical model etc.
 It is integrated with the dominant relational model.
Disadvantages of Entity-Relationship Model
 There is no industry standard for developing an ER model.
 Information might be lost or hidden in the ER model.
 There is no Data Manipulation
 There is limited relationship representation.
4. Relational Model
The relational model uses a collection of tables to represent both data and the relationships. Tables are also
known as relations. Each table has multiple columns represent as attributes; Attributes are the properties
which define a relation. Each row of the table represents as Tuple, Tuple is one piece of information.
Terminologies used in Relational Model
 Tables: relations are saved in the table format. A table has two properties rows and columns
 Attribute: columns represent as attributes
 Tuple: A Row represents as Tuple
 Relation Schema: A relation schema represents the name of the relation with its attributes.
 Degree: The total number of attributes which in the relation is called the degree of the relation.
 Cardinality: Total number of rows present in the Table.
 Column: The column represents the set of values for a specific attribute.
 Relation instance: The set of tuples of a relation at a particular instance of time is called as relation
instance.
Advantages of Relational Model
 Structural Independence: Structural independence is an ability that allows us to make changes in
one database structure without affecting other. The relational model have structural independence.
Hence making required changes in the database is convenient in relational database model.
 Conceptual Simplicity: The relational model allows the designer to simply focus on logical design
and not on physical design. Hence relational models are conceptually simple to understand.
 Query Capability: Using simple query language (such as SQL) user can get information from the
database or designer can manipulate the database structure.
 Easy design, maintenance and usage: The relational models can be designed logically hence they
are easy to maintain and use.
Disadvantages of Relational Model
 Relational model requires powerful hardware and large data storage devices.
 May lead to slower processing time.
 Poorly designed systems lead to poor implementation of database systems.
5. Object-Based Data Model
The complex real world problems are represented as objects with different attributes. In Object Oriented
Data Model, data and their relationships are contained in a single structure which is referred as object. All
objects have multiple relationships between them. Basically, it is combination of Object Oriented
programming and Relational Database Model.
Components of Object Oriented Data Model
1. Objects: An object is an abstraction of a real world entity or we can say it is an instance of class.
Objects encapsulates data and code into a single unit which provide data abstraction by hiding the
implementation details from the user.
2. Attribute: An attribute describes the properties of object.
3. Methods: Method represents the behavior of an object, it represents the real-world action
4. Class: A class is a collection of similar objects with shared structure i.e. attributes and behavior.
5. Inheritance: new classes are created from the existing classes
Advantages of Object-Based Data Model
 Reduced Maintenance
 Real-World Modeling
 Improved Reliability and Flexibility
 High Code Reusability
Disadvantages of Object-Based Data Model
 It is a complex navigational system.
 Slow development of standards.
 High system overheads.
 Slow transactions.
6. Semi-structured Data model
The semi-structured data model permits the specification of data where individual data items of same type
may have different sets of attributes. The Extensible Markup Language (XML) is widely used to represent
semistructured data model.
Advantages of Semi-structured Data Model
 Data is not constrained by fixed schema.
 It is flexible.
 It is portable.
Disadvantage of Semi-structured Data Model
 Queries are less efficient than other types of data model.
Levels of Abstraction in DBMS
Data Abstraction is a process of hiding unwanted or irrelevant details from the end user. It provides a
different view and helps in achieving data independence which is used to enhance the security of data.
The database systems consist of complicated data structures and relations. For users to access the data easily,
these complications are kept hidden, and only the relevant part of the database is made accessible to the
users through data abstraction.
Levels of abstraction for DBMS
Database systems include complex data-structures. In terms of retrieval of data, reduce complexity in terms
of usability of users and in order to make the system efficient, developers use levels of abstraction that hide
irrelevant details from the users. Levels of abstraction simplify database design.
Mainly there are three levels of abstraction for DBMS
1. Physical or Internal Level
2. Logical or Conceptual Level
3. View or External Level

1. Physical or Internal Level


The internal level has an internal schema which describes the physical storage structure of the database.
The internal schema is also known as a physical schema.
It uses the physical data model. It is used to define that how the data will be stored in a block.
The physical level is used to describe complex low-level data structures in detail.
Facts about Internal schema
 The internal schema is the lowest level of data abstraction
 It helps you to keeps information about the actual representation of the entire database. Like the
actual storage of the data on the disk in the form of records
 The internal view tells us what data is stored in the database and how
2. Logical or Conceptual Level
The conceptual schema describes the design of a database at the conceptual level. Conceptual level is also
known as logical level.
The conceptual schema describes the structure of the whole database.
The conceptual level describes what data are to be stored in the database and also describes what
relationship exists among those data.
In the conceptual level, internal details such as an implementation of the data structure are hidden.
Programmers and database administrators work at this level.
Facts about Conceptual schema
 Defines all database entities, their attributes, and their relationships
 Security and integrity information
 In the conceptual level, the data available to a user must be contained in or derivable from the
physical level.
3. View or External Level
It hides the unrelated details of the database from the user. There may be “n” number of external views for
each database.
Each external view is defined using an external schema, which consists of definitions of various types of
external record of that specific view.
View level can be used by all users (all levels' users). This level is the least complex and easy to understand.
Facts about External schema
 An external level is only related to the data which is viewed by specific end users.
 This level includes some external schemas.
 External schema level is nearest to the user
 An external schema is also known as view schema.
 Each view schema describes the database part that a particular user group is interested and hides the
remaining database from that user group.
 The view schema describes the end user interaction with database systems.
Data Independence
Data Independence in DBMS
The ability to modify the schema definition of a DBMS at one level, without affecting the schema definition of the
next higher level is called data independence. It's of two types,
 Physical Data Independence
 Logical Data Independence
1. Physical Data Independence:
The physical data independence is basically used to separate conceptual levels from the internal/physical levels. It is
easy to achieve physical data independence. With this type of independence, user is able to change the physical
storage structures or the devices which have an effect on the conceptual schema.

Examples of changes under Physical Data Independence:


 It is by the use of new storage device like Hard Drive or Magnetic Tapes Modifying the file organization
technique in the Database
 Switching to different data structures.
 Changing the access method.
 Modifying indexes.
 To change the compression techniques or hashing algorithms.
 To change the Location of Database from say C drive to D Drive.
2. Logical Data Independence:
Logical Data Independence is used to change the conceptual scheme without changing the following things:
 External views
 External API or programs
Examples of changes under Logical Data Independence:
 To Add/Modify/Delete a new attribute, entity or relationship is possible without a rewrite of existing
application programs
 Merging two records into one
 To break an existing record i.e. to divide the record into two or more records
Difference between Physical and Logical Data Independence

Physical Data Independence Logical Data Independence

 It is concerned with the internal schema of the  It is concerned with the conceptual schema of the
database. database.

 It is easier to achieve as compared to logical data  Logical data independence is difficult to achieve as
independence. compared to physical data independence.

 Physical data independence is mostly concerned  It is mostly focused on the structure or updating data
with how data is saved in the system. definitions.

 Changes at the internal level may or may not be  When the database's logical structure needs to be
required to increase the overall performance of the modified, the changes made at the logical level are
database. crucial.

 In most cases, a change at the physical level does  If new fields are added or removed from the database,
not necessitate a change at the application then updates are required to be made in the application
program level. software.

Importance of Data Independence


One of the highest advantage of databases is data independence. It means we can change the conceptual
schema at one level without affecting the data at another level. It also means we can change the structure of a
database without affecting the data required by users and programs.
Structure of DBMS
Database System Architecture
The typical structure of DBMS is based on Relational data model.
The top part of the architecture shows application interfaces used by naive users, application programs created by
application programmers, query tools used by sophisticated users and administration tools used by database
administrator.
The lowest part of the architecture is for disk storage.
The Middle two parts (Query processor and storage manager) are important components of database architecture.

Query processor:
The interactive query processor helps the database system to simplify and facilitate access to data. It consists of
DDL(Data Definition Language) interpreter, DML(Data Manipulation Language) compiler and query evaluation
engine.
The following are various functionalities and components of query processor
 DDL interpreter: This is basically a translator which interprets the DDL statements in data dictionaries.
 DML compiler: It translates DML statements query language into an evaluation plan. This plan consists of
the instructions which query evaluation engine understands.
 Query evaluation engine: It executes the low-level instructions generated by the DML compiler.
When a user issues a query, the parsed query is presented to a query optimizer, which uses information about how the
data is stored to produce an efficient execution plan for evaluating the query. An execution plan is a blueprint for
evaluating a query. It is evaluated by query evaluation engine.
Storage manager:
Storage manager is the component of database system that provides interface between the low level data stored in the
database and the application programs and queries submitted to the system.
The storage manager is responsible for storing, retrieving, and updating data in the database. The storage manager
components include
 Authorization and integrity manager: Validates the users who want to access the data and tests for integrity
constraints.
 Transaction manager: Ensures that the database remains in consistent despite of system failures and
concurrent transaction execution proceeds without conflicting.
 File manager: Manages allocation of space on disk storage and representation of the information on disk.
 Buffer manager: Manages the fetching of data from disk storage into main memory. The buffer manager also
decides what data to cache in main memory. Buffer manager is a crucial part of database system.
Storage manager implements several data structures such as
 Data files: Used for storing database itself.
 Data dictionary: Used for storing metadata, particularly schema of database.
 Indices: Indices are used to provide fast access to data items present in the database.

Database Design in DBMS


Database design is the organization of data according to a database model. Properly designed databases are easu to
maintain, improves data consistency.
The database design process can be divided into six steps. The ER model (Entity Relationship model) is most relevant
to the first three steps.
1. Requirement analysis
2. Conceptual database design
3. Logical database design
4. Schema refinement
5. Physical database design
6. Application and security design
1. Requirement analysis
 It is necessary to understand what data need to be stored in the database, what applications must be built,
what are all those operations that are frequently used by the system.
 The requirement analysis is an informal process and it requires proper communication with user groups.
 There are several methods for organizing and presenting information gathered in this step. Some automated
tools can also be used for this purpose.
2. Conceptual database design
 The information gathered, is used to develop a high-level description of the data to be stored in the database
 This is a step in which E-R Model i.e. Entity Relationship model is built.
 The goal of this design is to create a simple description of data that matches with the requirements of users.
3. Logical database design
 This is a step in which ER model in converted to relational database schema, sometimes called as the logical
schema in the relational data model.
4. Schema refinement
 In this step, relational database schema is analyzed to identify the potential problems and to refine it.
 The schema refinement can be done with the help of normalizing and restructuring the relations.
5. Physical database design
 The design of database is refined further.
 This step may simply involve building indexes on tables and clustering tables, redesign of parts of the
database schema obtained from the earlier design steps.
6. Application and security design
 Using design methodologies like UML (Unified Modeling Language) try to address the complete software
design of the database can be accomplished.
 The role of each entity in every process must be reflected in the application task.
 For each role, there must be the provision for accessing and prohibiting some part of database.
 Thus, some access rules must be enforced on the application (which is accessing the database) to protect the
security features.

ER Diagrams in DBMS
ER model in DBMS is the high-level data model. It stands for the Entity-relationship model and is used to
represent a logical view of the system from a data perspective. In simple words, the entity relationship
diagram is a blueprint that can used to create a database. E-R diagrams are used to model real-world objects
like a person, a car, a company and the relation between these real-world objects.
Features of ER model
 E-R diagrams are used to represent E-R model in a database, which makes them easy to be converted
into relations (tables).
 E-R diagrams provide the purpose of real-world modeling of objects which makes them intently
useful.
 E-R diagrams require no technical knowledge and no hardware support.
 These diagrams are very easy to understand and easy to create even by a naive user.
 It gives a standard solution of visualizing the data logically.
ER diagram basically having three components:
1. Entities − It is a real-world thing which can be a person, place, or even a concept. For Example:
Department, Admin, Courses, Teachers, Students, Building, etc are some of the entities of a School
Management System.
2. Attributes − An entity which contains a real-world property called an attribute. For Example: The
entity employee has the property like employee id, salary, age, etc.
3. Relationship − Relationship tells how two attributes are related. For Example: Employee works for a
department.
Component Symbol
Entity

Weak Entity

Attribute

Key Attribute

Composite Attribute

Multivalued Attribute
Component Symbol
Derived Attribute

Relationship

Weak Relationship

Participation Constraints

Entity in DBMS
Entity: An entity is anything in the real world, such as an object, class, person, or place. Objects that
physically exist and are logically constructed in the real world are called entities. An entity is distinguishable
from other entity.
Entity type: The entity type is a collection of the entity having similar attributes.
Entity set: is a group of entities of similar kinds. It can contain entities with attributes that share similar
values. It's collectively a group of entities of a similar type. The entity set need not be disjoint.
In summary, an Entity is an object of a Type Entity and the set of all entities is called an entity set.
Entities are of two types:
Strong Entity – A strong entity is an entity type that has a key attribute. It doesn't depend on other entities in
the schema. A strong entity always has a primary key, and it is represented by a single rectangle in the ER
diagram.

Weak Entity-An entity that depends on another entity called a weak entity. The weak entity doesn't contain
any key attribute of its own. The weak entity is represented by a double rectangle.
Strong Entity v/s Weak Entity

Strong Entity Weak Entity

Strong entity always has a primary key. While a weak entity has a partial discriminator key.

Strong entity is not dependent on any other Weak entity depends on strong entity.
entity.

Strong entity is represented by a single Weak entity is represented by a double rectangle.


rectangle.

Two strong entity’s relationship is While the relation between one strong and one weak entity
represented by a single diamond. is represented by a double diamond.

Strong entities have either total While weak entity always has total participation.
participation or not.

Attributes in DBMS
An entity which contains a real-world property called an attribute. For Example: The entity employee has
the property like employee id, salary, age, etc.
Following is the Attributes of an Entity
o Simple Attribute:
It is also known as atomic attributes. When an attribute cannot be divided further, then it is called a simple
attribute.

For example, in a student table, the age attribute cannot be further divided. It is called a simple or atomic
attribute because it contains only a single value that cannot be broken further.
o Composite Attribute:
Composite attributes are those that are made up of the composition of more than one attribute. When any
attribute can be divided further into more sub-attributes, then that attribute is called a composite attribute.
For example, in a student table, we have attributes of student names that can be further broken down into
first name, middle name, and last name. So, the student’s name will be a composite attribute.
Another example from a personal detail table would be the attribute of address. The address can be divided
into a street, area, district, and state.
o Single-valued Attribute:
Those attributes which can have exactly one value are known as single valued attributes. They contain
singular values, so more than one value is not allowed.

For example, the Age of a student can be a single valued attribute. Another example is gender because one
person can have only one gender.
o Multi-valued Attribute:
Those attributes which can have more than one entry or which contain more than one value are called multi
valued attributes.
In the Entity Relationship (ER) diagram, we represent the multi valued attribute by double oval
representation.

For example, the hobbies of a person because one can have more than one hobby, so that it would be a multi
valued attribute. Another example is one person can have more than one phone number.
Derived Attribute:
When one attribute can be derived from the other attribute, then it is called a derived attribute. We can do
some calculations on normal attributes and create derived attributes.
For example, the age of a student can be a derived attribute because we can get it by the DOB of the
student.
Another example can be of working experience, which can be obtained by the date of joining of an
employee.
In the ER diagram, we represent the derived attributes by a dotted oval shape.
o Key Attribute:
Those attributes which can be identified uniquely in the relational table are called key attributes.

For example, a student roll-no is a unique attribute.


Student Entity with all types of Attributes
We can understand the attributes by the following example:

In the above example, we have an ER diagram of a table named Student. We have a lot of attributes from the
above table.
o DOB is a single valued attribute that can have only one value.
o Name is a composite attribute because it is made up of a first name and the last name as the middle
name attribute.
o Age attribute is a derived attribute, and it is represented by a dotted oval. We can get the age by the
other attribute DOB.
o Hobbies is a multi-valued attribute because one student can have more than one hobby, which is
represented by a double oval representation.
o Roll no is a key attribute that can have a unique value (roll no) for each student.
Relationships in DBMS
A relationship is defined as an association among several entities.
Relationship Set
A set of relationships of similar type is called a relationship set. Like entities, a relationship too can have
attributes. These attributes are called descriptive attributes.
Mapping Cardinalities:
express the number of entities to which another entity can be associated via a relationship. For binary
relationship sets between entity sets A and B, the mapping cardinality must be one of:
One-to-one: An entity in A is associated with at most one entity in B, and an entity in B is associated with at
most one entity in A.

One-to-many: An entity in A is associated with any number in B. An entity in B is associated with at most
one entity in A.

Many-to-one: An entity in A is associated with at most one entity in B. An entity in B is associated with any
number in A.

Many-to-many: Entities in A and B are associated with any number from each other.

The appropriate mapping cardinality for a particular relationship set depends on the real world being
modeled.
Degree of a Relationship Set
The number of entity sets that participate in a relationship set is termed as the degree of that relationship set.
Thus,
Degree
Degree of a relationship set = Number of entity sets participating in a relationship set
Types of Relationship Sets
On the basis of degree of a relationship set, a relationship set can be classified into the following types-
 Unary relationship set
 Binary relationship set
 Ternary relationship set
Unary Relationship Set
Unary relationship set is a relationship set where only one entity set participates in a relationship set.

Binary Relationship Set


Binary relationship set is a relationship set where two entity sets participate in a relationship set.

Ternary Relationship Set


Ternary relationship set is a relationship set where three entity sets participate in a relationship set.

Participation Constraints
Total Participation of an Entity set
Total participation of an entity set represents that each entity in entity set must have at least one relationship
in a relationship set. It is also called mandatory participation. Total participation is represented using a
double line between the entity set and relationship set.
Partial participation of an Entity Set
Partial participation of an entity set represents that each entity in the entity set may or may not participate in
the relationship instance in that relationship set. It is also called as optional participation. Partial
participation is represented using a single line between the entity set and relationship set.

Additional Features of the ER Model in DBMS


As the complexity of data increased, it became more and more difficult to use the traditional ER Model for
database modelling. Hence some Additional Features were made to the existing ER Model to make it able to
handle the complex applications better.
Hence, three new concepts were added to the existing ER Model, they were:
 Generalization
 Specialization
 Aggregation
Some entities have relationships that form hierarchies. For instance, Employee can be an hourly employee or
contracted employee.
In this relationship hierarchies, some entities can act as superclass and some other entities can act as
subclass.
Superclass: An entity type that represents a general concept at a high level, is called superclass.
Subclass: An entity type that represents a specific concept at lower levels, is called subclass.
The subclass is said to inherit from superclass. When a subclass inherits from one or more superclasses, it
inherits all their attributes. In addition to the inherited attributes, a subclass can also define its own specific
attributes.
The symbol used for specialization/ Generalization is

Generalization
Generalization is a process of extracting common properties from a set of entities and creating a generalized
entity from it. It is a bottom-up approach, and it helps to reduce the size and complexity of the schema.
Example: Let us take two low-level entities as Car and Bus, and these two will have many common
attributes and some specific attributes. And We will generalize and link the common attributes to the newly
formed high-level entity named Vehicle.
Specialization
Specialization is opposite to Generalization. In this, entity is divided into subentities bases on their
charactertics(distingvishing features). It breaks an entity into multiple entities from higher level to lower
level. It is a top down approach.
Aggregation
Aggregation refers to the process by which entities are combined to form a single meaningful entity. The
specific entities are combined because they do not make sense on their own. To establish a single entity,
aggregation creates a relationship that combines these entities. The resulting entity makes sense because it
enables the system to function well.

You might also like