0% found this document useful (0 votes)
29 views31 pages

Unit 1 Cse

The document provides a historical perspective on Database Management Systems (DBMS), detailing their evolution from early hierarchical models to contemporary relational models and applications across various sectors such as banking, education, and healthcare. It discusses the differences between file systems and DBMS, emphasizing the advantages of DBMS in terms of data integrity, security, and efficiency. Additionally, it outlines various data models, levels of data abstraction, and the concept of data independence, highlighting the importance of these elements in database design and management.

Uploaded by

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

Unit 1 Cse

The document provides a historical perspective on Database Management Systems (DBMS), detailing their evolution from early hierarchical models to contemporary relational models and applications across various sectors such as banking, education, and healthcare. It discusses the differences between file systems and DBMS, emphasizing the advantages of DBMS in terms of data integrity, security, and efficiency. Additionally, it outlines various data models, levels of data abstraction, and the concept of data independence, highlighting the importance of these elements in database design and management.

Uploaded by

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

UNIT– I

A Historical perspective:
The first database management systems (DBMS) were created to handle complex data for businesses
in the 1960s. These systems included Charles Bachman’s Integrated Data Store (IDS) and
IBM’s Information Management System (IMS). Databases were first organized into tree-like
structures using hierarchical and network models.
Edgar F. Codd popularized the relational model in the 1970s, transforming database
management systems (DBMS) with the concept of arranging data in tables, or relations and utilizing
SQL for queries. As a result, contemporary DBMS systems like Oracle and MySQL were
established. These systems are still developing today, incorporating newer technologies like
NoSQL databases to handle unstructured data.

Applications of DBMS:
A Database Management System (DBMS) makes easier to create, maintain and work with the databases.It
acts as the channel between end users and the database enabling the functions including administration,
retrieval, updating and storing of data. By structuring data into the organized formats and controlling
concurrent access
the database management systems (DBMSs) contribute to the efficient handling, security and integrity of data.
There are different fields where a database management system is utilized. Following are a few applications
that utilize the information base administration framework.

DBMS applications range from banking to education, ensuring the effective management of large amounts
of data. Understanding the various applications of DBMS is crucial for database professionals and students
alike.
1. Railway Reservation System
In the rail route reservation framework, the information base is needed to store the record or information of
ticket appointments, status of train’s appearance, and flight. Additionally, if trains get late, individuals
become
acquainted with it through the information base update.
2. Library Management System
There are many books in the library so; it is difficult to store the record of the relative multitude of books in
a register or duplicate. Along these lines, the data set administration framework (DBMS) is utilized to keep
up all the data identified with the name of the book, issue date, accessibility of the book, and its writer.

1
3. Banking
Database the executive’s framework is utilized to store the exchange data of the client in the information
base.
4. Education Sector
Presently, assessments are led online by numerous schools and colleges. They deal with all
assessment information through the data set administration framework (DBMS). In spite of that
understudy’s enlistments subtleties, grades, courses, expense, participation, results, and so forth all the data
is put away in the information base.
5. Credit card exchanges
The database Management framework is utilized for buying on charge cards and age of month to month
proclamations.
6. Social Media Sites
We all utilization of online media sites to associate with companions and to impart our perspectives
totheworld.
Every day, many people group pursue these online media accounts like Pinterest, Facebook, Twitter, and
Google in addition to. By the utilization of the data set administration framework, all the data of clients are
put away in the information base and, we become ready to interface with others.
7. Broadcast communications
Without DBMS any media transmission organization can’t think. The Database the executive’s framework
is fundamental for these organizations to store the call subtleties and month to month postpaid bills in
the information base.
8. Accounting and Finance
The information base administration framework is utilized for putting away data about deals, holding
and acquisition of monetary instruments, for example, stocks and bonds in a data set.
9. E-Commerce Websites
These days, web-based shopping has become a major pattern. Nobody needs to visit the shop and burn
through their time. Everybody needs to shop through web based shopping sites, (for example,
Amazon, Flipkart, Snapdeal) from home. So all the items are sold and added uniquely with the assistance of
the information base administration framework (DBMS). Receipt charges, installments, buy data these
are finished with the assistance of DBMS.
10. Human Resource Management
Big firms or organizations have numerous specialists or representatives working under them. They store
data about worker’s compensation, assessment, and work with the assistance of an information
base administration framework (DBMS).
11. Manufacturing
Manufacturing organizations make various kinds of items and deal them consistently. To keep the data
about their items like bills, acquisition of the item, amount, inventory network the executives, information
base administration framework (DBMS) is utilized.
12. Airline Reservation System
This framework is equivalent to the railroad reservation framework. This framework additionally utilizes
an information base administration framework to store the records of flight takeoff, appearance, and
defer status.
13. Healthcare System
DBMS is used in healthcare to manage patient data, medical records, and billing information.
14. Security
DBMS provides security features to ensure that only authorized users have access to the data.
15. Telecommunication
Database Management Systems (DBMS) are essential to the telecommunications industry because they
manage enormous volumes of data on billing, customer information, and network optimization.

2
Difference Between File System and DBMS
Basics File System DBMS

The file system is a way of arranging


DBMS is software for managing the
the files in a storage medium within
database.
Structure a computer.

Data Redundant data can be present in a


In DBMS there is no redundant data.
Redundancy file system.

It doesn’t provide Inbuilt mechanism


It provides in house tools for backup
Backup and for backup and recovery of data if it
and recovery of data even if it is lost.
Recovery is lost.

Query There is no efficient query Efficient query processing is there in


processing processing in the file system. DBMS.

There is more data consistency


There is less data consistency in the
because of the process
file system.
Consistency of normalization .

It is less complex as compared to It has more complexity in handling as


Complexity DBMS. compared to the file system.

Security File systems provide less security in DBMS has more security mechanisms
Constraints comparison to DBMS. as compared to file systems.

It has a comparatively higher cost than


It is less expensive than DBMS.
Cost a file system.

In DBMS data independence exists,


mainly of two types:
There is no data independence.
Data 1) Logical Data Independence .
Independence 2)Physical Data Independence.

Only one user can access data at a Multiple users can access data at a
User Access time. time.

The users are not required to write The user has to write procedures for
Meaning procedures. managing databases

Data is distributed in many files. So, Due to centralized nature data sharing
Sharing it is not easy to share data. is easy

Data It give details of storage and It hides the internal details of


Abstraction representation of data Database

3
Basics File System DBMS

Integrity Constraints are difficult to Integrity constraints are easy to


Integrity implement implement
Constraints

To access data in a file , user


requires attributes such as file name, No such attributes are required.
file location.
Attribute s

Example Cobol , C++ Oracle , SQL Server

The Data Model :


A Data Model in Database Management System (DBMS) is the concept of tools that are developed
to summarize the description of the database. Data Models provide us with a transparent picture of
data which helps us in creating an actual database. It shows us from the design of the data to its
proper implementation of data.

Types of Relational Models


1.Conceptual Data Model
2. Representational Data Model
3.Physical Data Model
It is basically classified into 3 types:-

1. Conceptual Data Model


The conceptual data model describes the database at a very high level and is useful to
understand the needs or requirements of the database. It is this model, that is used in the requirement-
gathering process i.e. before the Database Designers start making a particular database.One such
popular model is the entity/relationship model (ER model).The E/R model specializes in entities,
relationships, and even attributes that are used by database designers. In terms of this concept,a
discussion can be made even with non-computer science(non-technical) users and stakeholders, and
their requirements can be understood.

Entity-Relationship Model( ER Model): It is a high-level data model which is used to define the
data and the relationships between them. It is basically a conceptual design of any database which is easy
to design the view of data.

Components of ER Model:
4
1.Entity: An entity is referred to as a real-world object. It can be a name, place, object, class, etc.
These are represented by a rectangle in an ER Diagram.
2.Attributes: An attribute can be defined as the description of the entity.These are represented by
Ellipse in an ER Diagram. It can be Age, Roll Number, or Marks for a Student.
3.Relationship: Relationships are used to define relations among different entities. Diamonds and
Rhombus are used to show Relationships.
Characteristics of a conceptual data model Offers Organization-wide coverage of the business concepts.
This type of Data Models are designed and developed for a business audience.
The conceptual model is developed independently of hardware specifications like data storage capacity,
location or software specifications like DBMS vendor and technology. The focus is to represent data as a
user will see it in the “real world.”Conceptual data models known as Domain models create a common
vocabulary for all stakeholders by establishing basic concepts and scope
2. Representational Data Model
This type of data model is used to represent only the logical part of the database and does
not represent the physical structure of the database.The representational data model allows us to focus
primarily, on the design part of the database. A popular representational model is a Relational model.
The relational Model consists of Relational Algebra and Relational Calculus. In the Relational Model,
we basically use tables to represent our data and the relationships between them.It is a theoretical
concept whose practical implementation is done in Physical Data Model.
The advantage of using a Representational data model is to provide a foundation to form the base for
the Physical model.
Characteristics of Representational Data Model
Represents the logical structure of the database.
Relational models like Relational Algebra and Relational Calculus are commonly used.
Uses tables to represent data and relationships.
Provides a foundation for building the physical data model.
3. Physical Data Model
The physical Data Model is used to practically implement Relational Data Model. Ultimately, all data in
a database is stored physically on a secondary storage device such as discs and tapes. This is stored
in the form of files, records, and certain other data structures. It has all the information on the format in
which the files are present and the structure of the databases,the presence of external data structures,
and their relation to each other. Here,we basically save tables in memory so they can be accessed
efficiently. In order to come up with a good physical model, we have to work on the relational model in
a better way. Structured Query Language (SQL) is used to practically implement Relational Algebra.
This Data Model describes HOW the system will be implemented using a specific DBMS system. This
model is typically created by DBA and developers. The purpose is actual implementation of the database.

Some Other Data Models


1. Hierarchical Model
The hierarchical Model is one of the oldest models in the data model which was developed by IBM, in the
1950s. In a hierarchical model, data are viewed as a collection of tables, or we can say segments that form
a hierarchical relation. In this, the data is organized into a tree-like structure where each record consists of
one parent record and many children. Even if the segments are connected as a chain-like structure by
logical associations, then the instant structure can be a fan structure with multiple branches. We call the
illogical associations as directional associations.
2. Network Model
The Network Model was formalized by the Database Task group in the 1960s. This model is the
generalization of the hierarchical model. This model can consist of multiple parent segments and these
segments are grouped as levels but there exists a logical association between the segments belonging to
any level. Mostly, there exists a many-to-many logical association between any of the two segments.
3. Object-Oriented Data Model
In the Object-Oriented Data Model, data and their relationships are contained in a single structure which is

5
referred to as an object in this data model. In this, real-world problems are represented as objects with
different attributes. All objects have multiple relationships between them. Basically, it is a combination of
Object Oriented programming and a Relational Database Model.
4. Float Data Model
The float data model basically consists of a two-dimensional array of data models that do not contain any
duplicate elements in the array. This data model has one drawback it cannot store a large amount of data
that is the tables can not be of large size.
5. Context Data Model
The Context data model is simply a data model which consists of more than one data model. For example,
the Context data model consists of ER Model, Object-Oriented Data Model, etc.This model allows users
to do more than one thing which each individual data model can do.
6. Semi-Structured Data Model
Semi-Structured data models deal with the data in a flexible way. Some entities may have extra attributes
and some entities may have some missing attributes. Basically, you can represent data here in a flexible
way.

Data Abstraction and Data Independence:


Database systems comprise complex data structures. In order to make the system efficient in terms
of retrieval of data, and reduce complexity in terms of usability of users, developers use abstraction
i.e. hide irrelevant details from the users. This approach simplifies database design.
Level of Abstraction in a DBMS
There are mainly 3 levels of data abstraction:
Physical or Internal Level
Logical or Conceptual Level
View or External Level
Physical or Internal Level
This is the lowest level of data abstraction. It tells us how the data is actually stored in memory. Access
methods like sequential or random access and file organization methods like B+ trees and hashing are
used for the same. Usability, size of memory, and the number of times the records are factors that we
need to know while designing the database.Suppose we need to store the details of an employee. Blocks of
storage and the amount of memory used for these purposes are kept hidden from the user.
Logical or Conceptual Level
This level comprises the information that is actually stored in the database in the form of tables. It also
stores the relationship among the data entities in relatively simple structures. At this level, the information
available to the user at the view level is unknown.We can store the various attributes of an employee and
relationships, e.g. with the manager can also be stored.The logical level thus describes the entire database in
terms of a small number of relatively simple structures. Although implementation of the simple structures at
the logical level may involve complex physical-level structures, the user of the logical level does not need to
be aware of this complexity. This is referred to as physical data independence. Database administrators, who
must decide what information to keep in the database, use the logical level of abstraction.
View or External Level
This is the highest level of abstraction. Only a part of the actual database is viewed by the users. This
level exists to ease the accessibility of the database by an individual user. Users view data in the form
of rows and columns. Tables and relations are used to store data. Multiple views of the same database
may exist. Users can just view the data and interact with the database, storage and implementation details
are hidden from them. Even though the logical level uses simpler structures, complexity remains because
of the variety of information stored in a large database.Many users of the database system do not need all
this information; instead, they need to access only a part of the database. The view level of abstraction
exists to simplify their interaction with the system
Example: In case of storing customer data,
Physical level – it will contains block of storages (bytes,GB,TB,etc)
6
Logical level – it will contain the fields and the attributes of data.
View level – it works with CLI or GUI access of database

Data Abstraction

The main purpose of data abstraction is to achieve data independence in order to save the time and cost
required when the database is modified or altered.

Data Independence
Data Independence is mainly defined as a property of DBMS that helps you to change the database
schema at one level of a system without requiring to change the schema at the next level. it helps to keep
the data separated from all program that makes use of it.
We have namely two levels of data independence arising from these levels of abstraction:
Physical level data independence
Logical level data independence

Physical Level Data Independence


It refers to the characteristic of being able to modify the physical schema without any alterations to the
conceptual or logical schema, done for optimization purposes, e.g., the Conceptual structure of the
database would not be affected by any change in storage size of the database system server. Changing
from sequential to random access files is one such example. These alterations or modifications to the
physical structure may include:
Utilizing new storage devices.
Modifying data structures used for storage.
Altering indexes or using alternative file organization techniques etc.

Logical Level Data Independence


It refers characteristic of being able to modify the logical schema without affecting the external schema or
7
application program. The user view of the data would not be affected by any changes to the conceptual
view of the data. These changes may include insertion or deletion of attributes, altering table structures
entities or relationships to the logical schema, etc.

Structure of Database Management System:


A Database Management System (DBMS) is software that allows users to define, store, maintain, and manage
data in a structured and efficient manner. It acts as an intermediary between data and users, allowing disparate
data from different applications to be managed. A DBMS simplifies the complexity of data processing by
providing tools to organize data, ensure its integrity, and prevent unauthorized access or loss of data. In today’s
data-driven world, DBMS are essential for applications such as banking systems, e-commerce platforms,
education, and medical systems. They not only store and manage large amounts of data, but also provide
functionality that provides performance, security, and scalability for multiple users with multiple access levels.
It also allows access to data stored in a database and provides an easy and
effective method of –
We are defining the information.
*Storing the information.
*Manipulating the information.
*We are protecting the information from system crashes or data theft.
*Differentiating access permissions for different users.
Understanding Data Theft
Data theft means the illicit extraction or manipulation of sensitive information stored in databases, servers, and
other storage systems. This is further defined, in DBMS, as improper access to confidential or sensitive data by
unauthorized persons. This may include information such as personal data, financial records, intellectual
property, or trade secrets. As digital data storage has grown, so has the threat of data theft; it is now a primary
priority concern with serious impacts on organizations worldwide.
Data theft can be carried out by, among others:
Hacking and exploiting: Attackers can use DBMS security gaps to access unauthorized sensitive data.
Insider threats: Employees or contractors compromise privileged access to information.
Phishing and social engineering: These are techniques that will trick the authorized user into
revealing the login credentials to enable intrusion.
Malware and ransomware attacks: These are malware that make database security vulnerable to
attack, thus giving access to attackers to steal data or lock down data until some amount of ransom is paid.
Data theft prevention is not only an issue in sensitive information matters but also for building trust between
businesses and clients. Controls over access, periodic audits, real-time monitoring of activities done through the
database are effective measures one could consider to reduce the risk. Also, following cyber security protocols
and periodic inundation of database systems will reduce most of the vulnerabilities.
Database Architecture vs. Tier Architecture
Structure of Database Management System is also referred to as Overall System Structure or Database
Architecture but it is different from the tier architecture of Database.
Components of a Database System
Query Processor, Storage Manager, and Disk Storage. These are explained as following below.

8
Architecture of DBMS

1. Query Processor:
It interprets the requests (queries) received from end user via an application program into instructions. It also
executes the user request which is received from the DML compiler.
Query Processor contains the following components –
DML Compiler: It processes the DML statements into low level instruction (machine language), so that
they can be executed.
DDL Interpreter:It processes the DDL statements into aset of table containing meta data (data about data).
Embedded DML Pre-compiler: It processes DML statements embedded in an application program
into procedural calls.
Query Optimizer: It executes the instruction generated by DML Compiler.
2. Storage Manager:
Storage Manager is a program that provides an interface between the data stored in the database and the queries
received. It is also known as Database Control System. It maintains the consistency and integrity of the
database by applying the constraints and executing the DCL statements. It is responsible for updating, storing,
deleting, and retrieving data in the database.
It contains the following components –
Authorization Manager: It ensures role-based access control, i.e,. checks whether the particular person
is privileged to perform the requested operation or not.
Integrity Manager: It checks the integrity constraints when the database is modified.
Transaction Manager: It controls concurrent access by performing the operations in a scheduled way
that it receives the transaction. Thus, it ensures that the database remains in the consistent state before and
after the execution of a transaction.

9
File Manager: It manages the file space and the data structure used to represent information in the database.
Buffer Manager: It is responsible for cache memory and the transfer of data between the secondary
storage and main memory.

3. Disk Storage:
It contains the following components:
Data Files: It stores the data.
Data Dictionary: It contains the information about the structure of any database object. It is the repository
of information that governs the metadata.
Indices: It provides faster retrieval of data item.
Levels of DBMS Architecture
The structure of a Database Management System (DBMS) can be divided into three main components: the
Internal Level, the Conceptual Level, and the External Level.
Internal Level:
This level represents the physical storage of data in the database. It is responsible for storing and retrieving data
from the storage devices, such as hard drives or solid-state drives. It deals with low-level implementation details
such as data compression, indexing, and storage allocation.
Conceptual Level:
This level represents the logical view of the database. It deals with the overall organization of data in the
database and the relationships between them. It defines the data schema, which includes tables, attributes, and
their relationships. The conceptual level is independent of any specific DBMS and can be implemented using
different DBMSs.
External Level:
This level represents the user’s view of the database. It deals with how users access the data in the database. It
allows users to view data in a way that makes sense to them, without worrying about the underlying
implementation details. The external level provides a set of views or interfaces to the database, which are tailored
to meet the needs of specific user groups.

Database Design and ER Diagram:


We typically follow the below steps for designing a database for an application. Gather the requirements
(functional and data) by asking questions to the database users. Do a logical or conceptual design of the
database. This is where ER model plays a role. It is the most used graphical representation of the conceptual
design of a database.
Physical Database Design (Like indexing) and external design (like views)
The Entity Relationship Model is a model for identifying entities (like student, car or company) to by
represented in the database and representation of how those entities are related. The ER data model specifies
enterprise schema that represents the overall logical structure of a database graphically.
Why Use ER Diagrams In DBMS?
ER diagrams represent the E-R model in a database, making them easy to convert into relations (tables).
ER diagrams provide the purpose of real-world modeling of objects which makes them intently useful.
ER diagrams require no technical knowledge of the underlying DBMS used.
It gives a standard solution for visualizing the data logically.
Symbols Used in ER Model
ER Model is used to model the logical view of the system from a data perspective which consists of these
symbols:
Rectangles: Rectangles represent Entities in the ER Model.
Ellipses: Ellipses represent Attributes in the ER Model.
Diamond: Diamonds represent Relationships among Entities.
Lines: Lines represent attributes to entities and entity sets with other relationship types.
Double Ellipse: Double Ellipses represent Multi-Valued Attributes.
10
Double Rectangle: Double Rectangle represents a Weak Entity.

S ymbols used in ER Diagram

Components of ER Diagram
ER Model consists of Entities, Attributes, and Relationships among Entities in a Database System.

What is Entity?
An Entity may be an object with a physical existence – a particular person, car, house, or employee – or it may
be an object with a conceptual existence – a company, a job, or a university course.
What is Entity Set?
An Entity is an object of Entity Type and a set of all entities is called an entity set. For Example, E1 is an entity
having Entity Type Student and the set of all students is called Entity Set. In ER diagram, Entity Type is
represented as:

Entity Set

We can represent the entity set in ER Diagram but can’t represent entity in ER Diagram because entity is row
and column in the relation and ER Diagram is graphical representation of data.

11
Types of Entity
There are two types of entity:
1. Strong Entity
A Strong Entity is a type of entity that has a key Attribute. Strong Entity does not depend on other Entity in
the Schema. It has a primary key, that helps in identifying it uniquely, and it is represented by a rectangle.
These are called Strong Entity Types.
2. Weak Entity
An Entity type has a key attribute that uniquely identifies each entity in the entity set. But some entity type
exists for which key attributes can’t be defined. These are called Weak Entity types .
For Example, A company may store the information of dependents (Parents, Children, Spouse) of an
Employee. But the dependents can’t exist without the employee. So Dependent will be a Weak Entity
Type and Employee will be Identifying Entity type for Dependent, which means it is Strong Entity Type .
A weak entity type is represented by a Double Rectangle. The participation of weak entity types is always total.
The relationship between the weak entity type and its identifying strong entity type is called identifying
relationship and it is represented by a double diamond.

Strong Entity and Weak Entity

What is Attributes?
Attributes are the properties that define the entity type. For example, Roll_No, Name, DOB, Age, Address,
and Mobile_No are the attributes that define entity type Student. In ER diagram, the attribute is represented by
an oval.

Attribute

Types of Attributes
1. Key Attribute
The attribute which uniquely identifies each entity in the entity set is called the key attribute. For
example, Roll_No will be unique for each student. In ER diagram, the key attribute is represented by an oval
with underlying lines.

Key Attribute
2. Composite Attribute
An attribute composed of many other attributes is called a composite attribute. For example, the
Address attribute of the student Entity type consists of Street, City, State, and Country. In ER diagram, the
composite attribute is represented by an oval comprising of ovals.

12
Composite Attribute

3. Multivalued Attribute
An attribute consisting of more than one value for a given entity. For example, Phone_No (can be more than
one for a given student). In ER diagram, a multivalued attribute is represented by a double oval.

Multivalued Attribute

4. Derived Attribute
An attribute that can be derived from other attributes of the entity type is known as a derived attribute. e.g. Age
(can be derived from DOB). In ER diagram, the derived attribute is represented by a dashed oval.

Derived Attribute
The Complete Entity Type Student with its Attributes can be represented as:

Entity and Attributes

13
7)Relationship and Relationship Set:
A Relationship Type represents the association between entity types. For example‘Enrolled in’ is a relationship
type that exists between entity type Student and Course. In ER diagram, the relationship type is represented by
a diamond and connecting the entities with lines.

Entity-Relationship Set

A set of relationships of the same type is known as a relationship set. The following relationship set depicts S1
as enrolled in C2, S2 as enrolled in C1, and S3 as registered in C3.

Relationship Set

Degree of a Relationship Set


The number of different entity sets participating in a relationship set is called the degree of a relationship
set.
1. Unary Relationship: When there is only ONE entity set participating in a relation, the relationship is
called a unary relationship. For example, one person is married to only one person.

Unary Relationship
2. Binary Relationship: When there are TWO entities set participating in a relationship, the relationship is
called a binary relationship. For example, a Student is enrolled in a Course.

Binary Relationship
14
3. Ternary Relationship: When there are three entity sets participating in a relationship, the relationship is
called a ternary relationship.
4. N-ary Relationship:When there are n entities set participating in a relationship, the relationship is called
an n-ary relationship.
What is Cardinality?
The number of times an entity of an entity set participates in a relationship set is known as cardinality .
Cardinality can be of different types:
1. One-to-One: When each entity in each entity set can take part only once in the relationship, the
cardinality is one-to-one. Let us assume that a male can marry one female and a female can marry one male. So
the relationship will be one-to-one.
the total number of tables that can be used in this is 2.

one to one cardinality

Using Sets, it can be represented as:

Set Representation of One-to-One

2. One-to-Many: In one-to-many mapping as well where each entity can be related to more than one entity
and the total number of tables that can be used in this is 2. Let us assume that one surgeon department can
accommodate many doctors. So the Cardinality will be 1 to M. It means one department has many Doctors.
total number of tables that can used is 3.

one to many cardinality

Using sets, one-to-many cardinality can be represented as:

Set Representation of One-to-Many

15
3. Many-to-One: When entities in one entity set can take part only once in the relationship set and entities in
other entity sets can take part more than once in the relationship set, cardinality is many to one. Let us assume
that a student can take only one course but one course can be taken by many students. So the cardinality will be
n to 1. It means that for one course there can be n students but for one student, there will be only one course.
The total number of tables that can be used in this is 3.

many to one cardinality


Using Sets, it can be represented as:

Set Representation of Many-to-One

In this case, each student is taking only 1 course but 1 course has been taken by many students.
4.Many-to-Many: When entities in all entity sets can take part more than once in the relationship cardinality
is many to many. Let us assume that a student can take more than one course and one course can be taken by
many students. So the relationship will be many to many.
the total number of tables that can be used in this is 3.

many to many cardinality

Using Sets, it can be represented as:

Many-to-Many Set Representation

In this example, student S1 is enrolled in C1 and C3 and Course C3 is enrolled by S1, S3, and S4. Soit is many-
to-many relationships.
Participation Constraint
Participation Constraint is applied to the entity participating in the relationship set.
1. Total Participation – Each entity in the entity set must participate in the relationship. If each student
must enroll in a course, the participation of students will be total. Total participation is shown by a double
line in the ER diagram.
2. Partial Participation – The entity in the entity set may or may NOT participate in the relationship. If
some courses are not enrolled by any of the students, the participation in the course will be partial.
The diagram depicts the ‘Enrolled in’ relationship set with Student Entity set having total participation and
Course Entity set having partial participation.
16
Total Participation and Partial Participation

Using Set, it can be represented as,

Set representation of Total Participation and Partial Participation

Every student in the Student Entity set participates in a relationship but there exists a course C4 that is not
taking part in the relationship.
How to Draw ER Diagram?
The very first step is Identifying all the Entities, and place them in a Rectangle, and labeling them accordingly.
The next step is to identify the relationship between them and place them accordingly using the Diamond, and
make sure that, Relationships are not connected to each other.
Attach attributes to the entities properly.
Remove redundant entities and relationships.
Add proper colors to highlight the data present in the database.
Entities:
An entity is a "thing" or "object" in the real world. An entity contains attributes, which describe that entity. So
anything about which we store information is called an entity. Entities are recorded in the database and must be
distinguishable, i.e., easily recognized from the group.
For example: A student, An employee, or bank a/c, etc. all are entities.

Attributes:
Attributes are properties or characteristics of an entity. Attributes are used to describe the entity. The attribute is
nothing but a piece of data that gives more information about the entity. Attributes are used to distinguish one
entity from the other entity. Attributes help to categorize the entity and the entity can be easily retrieved and
manipulate the entity. Attributes can help the database to be more structural and hierarchical. An entity with no
attribute is of no use in the database.
Example
Let's take the student as an entity. Students will have multiple attributes such as roll number, name, and class.
These attributes are used to describe the student in more detail.

17
As shown in the figure, roll_no, name, and class are the attributes of the entity Student.
All three attributes give meaning to the entity. The information about the student entity lies in all 3 attributes.
Types Of Attribute
There are 8 types of attributes in DBMS.
Simple Attribute.
Composite Attribute.
Single Valued Attribute.
Multivalued Attribute.
Key Attribute.
Derived Attribute.
Stored Attribute.
Complex Attribute.
Let's look at all attributes one by one.
Simple Attribute
Simple attributes are those attributes that cannot be divided into more attributes. Simple attributes state the
simple information about the entity such as name, roll_no, class, age, etc.
Simple attributes are widely used for storing information about the entity.
Example
Here in the below example, Student has roll_no, class, and name as attributes that cannot be divided into more
sub-attributes.
These types of attributes are called simple attributes.
Simple attributes are mainly used to create all other types of attributes.

Simple Attribute
18
Composite Attribute
When 2 or more than 2 simple attributes are combined to make an attribute then that attribute is called
a Composite attribute.
The composite attribute is made up of multiple attributes. After combining these attributes, the composed
attributes are formed.
Complex attributes are used where data is complex and needs to be stored in a complex structure.
Example
Here if we look at the below example, address is the attribute derived from the 3 simple attributes i.e. City,
State, and Street.
To get the value of the address attribute, we have first to know those city, state, and street attributes.
This type of attribute is known as a composite attribute.

Composite Attribute
Single Valued Attribute
The attribute with only a single value is known as a single-valued attribute. These attributes have a single
value for each instance of a given entity.
Mostly these attributes are used to provide the unique identity to the multiple instances of attributes.
Example
In the given example, we know that the DOB attribute will have only one value. So we can say that the DOB
attribute is nothing but a single Valed attribute and it cannot have multiple attributes.
Here roll_no and name will also have mostly one value only.
We can say that all 3 attributes of the student are single-valued.

Single valued attribute

19
Multivalued Attribute
An attribute which can have multiple values is known as a multivalued attribute. Multivalued attributes
have multiple values for the single instance of an entity.
Keu of entity is associated with multiple values. It does not have only one value. It is the opposite of the single-
valued attribute.
Example
Here the student has an attribute named phone_no. One student can have multiple phone_no, so we can say that
phone_no can have multiple values.
These types of attributes are known as multi-valued attributes.
Multi-valued attributes are used when more than 1 entries for one attribute need to be stored in the Database.

Multi-valued attribute
Key Attribute
The attribute which has unique values for every row in the table is known as a Key Attribute. The key
attribute has a very crucial role in the database.
The key attribute is a distinct and unique characteristic of the entity that can be used to identify the entity
uniquely.
Example
For students, we can identify every student with roll_no because each student will have a unique roll_no.
This indicates that roll_no will be a Key attribute for the Student entity.
All operations on the database can be performed only using Key Attributes.

Key attribute
Derived Attribute
The attribute that can be derived from the other attributes and does not require to be already present in the
database is called a Derived Attribute.
Derived attributes are not stored in the Database directly. It is calculated by using the stored attributes in the
database.
Example
20
Here the student has multiple attributes including DOB and age. It is observed that age can be calculated with
the help of the DOB attribute.
So age is a derived attribute that is derived from an attribute named DOB.

Derived attribute
Stored Attribute
If the data of the attribute remains constant for every instance of entity then it is called a Stored Attribute.
The value of the attribute present in the database does not get updated and it remains constant once it is stored.
These attributes are used to store permanent information about an entity which will remain constant throughout
the lifetime of the entity.
Example
The student has 3 attributes as shown above. Her name and DOB will remain the same throughout his/her
education. So the student has a fixed value attribute that will never change in the future.
These attributes are known as stored attributes.

Stored attributes
Complex Attribute
When multi-valued and composite attributes together form an attribute then it is called a Complex attribute.
Complex attributes can have an unlimited number of sub-attributes.
Example
Here for the student, we created an attribute named contact_info which further decomposed into phone_no +
Address.
The address is a composite attribute which is further divided into simple attributes and phone_no is a
multivalued attribute.
This indicates that the contact_info attribute is made from the multi-valued and composite attribute.
This type of attribute is known as the Complex Attribute.

21
Entity Sets:
An entity set is a collection of similar types of entities that share the same attributes.
For example: All students of a school are a entity set of Student entities.
Key Terminologies used in Entity Set:
Attributes: Attributes are the houses or traits of an entity. They describe the data that may be
connected with an entity.
Entity Type: A category or class of entities that share the same attributes is referred to as an
entity kind.
Entity Instance: An entity example is a particular incidence or character entity within an entity
type. Each entity instance has a unique identity, often known as the number one key.
Primary Key: A primary key is a unique identifier for every entity instance inside an entity kind.
It can be classified into two types:
Strong Entity Set
Strong entity sets exist independently and each instance of a strong entity set has a unique
primary key.
Example of Strong Entity includes:
Car Registration Number
Model
Name etc.

Strong Entity

Weak Entity Set


A weak entity cannot exist on its own; it is dependent on a strong entity to identify it. A weak
entity does not have a single primary key that uniquely identifies it; instead, it has a partial key.
Example of Weak Entity Set includes:
22
Laptop Color
RAM, etc.

Weak Entity

7)Relationships and Relationship Sets:


Relationship set in a Database Management System (DBMS) is essential as it provides the ability to
store,recover, and oversee endless sums of information effectively in cutting-edge data administration, hence
making a difference in organizations.In a Relational database, relationship sets are built up by utilizing keys,
such as primary and foreign keys, to interface related records over distinctive tables.Understanding and
appropriately characterizing relationship sets is fundamental for planning a well-organized and utilitarian
database framework, guaranteeing the exact representation and administration of information.
What is a Relation?
A Relation in a database management system (DBMS) organizes information into rows and columns. This
organized arrangement makes a difference in information storing and recovering information proficiently.
Relations permit us to query information utilizing SQL commands like SELECT, Update, Insert, and Delete.
Henceforth, it becomes easier and more demanding to control and extract data from the database.
Relations are alluded to as tables within the database management system.

What is a Relationship Set?


It is a set of Relationships of the Same type.Mathematical Relation on m > 2 (Possibly non-distinct) entity Sets.
If E1, E2,... En are the entity sets for the Relationship Set R is a subset of {(e1, e2,... en) | e1 € E1, e2 € E2...en
€ En} Where (e1, e2,...en) is a Relationship.
For Example, (E-R Diagram)

Relationship Set
Characteristics of Relationship Set
Degree: Degree of a relationship set indicates to the number of properties related with the relationship set.
Arity: Arity of a relationship set indicates the number of taking part relations. It can be like double (including
two relations), ternary (including three relations), and so on.
Cardinality: Cardinality characterizes the number of occurrences or records that can be related with each
substance on both sides of the relationship.
This permits for the execution of different sorts of connections, such as one-to-one, one-to-many, and many-to-
many, reflecting real-world associations between substances.
Degree of Relationship Set
It denotes the number of entity sets that belong to that particular relationship set is called the degree of that
relationship set.
23
Degree of a Relationship Set = the number of entity set that belongs to that particular relationship set
Relationship Set Example With Tables
Let 'Customer' and 'Loan' entity sets defines the Relationship 'set Borrow' to denote the association between
Customer and bank loans.

Relationship Set between Customer and Loan


In the above example, In table Customer shows a customer borrows a loan from Table Loan. In other words,
the relationship borrows will be one to one.
Examples
1. Student-Student ID Relationship
In a one-to-one relationship, each student is assigned a unique student ID.

one to one
2. Teacher-Student Relationship
Consider two relations: Teacher and Student. The relationship set between them can be characterized as
“mentors.” Each teacher mentors in one class, but a class can have numerous students. So one teacher can
have many students.
This is often an illustration of a one-to-many relationship.

one to many
3. Student-Course Relationship
In this situation, we have two relations: Understudy and Course. The relationship set between them can be
characterized as “enrolled_in.” Each understudy can be selected in numerous courses, and each course can
have different understudies.
This can be an illustration of a many-to-many relationship.

many to many

24
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
Aggregration
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.
Generalization
Generalization is the process of extracting common properties from a set of entities and creating a
generalized entity from it. It is a bottom-up approach in which two or more entities can be generalized to a
higher-level entity if they have some attributes in common. For Example, STUDENT and FACULTY can
be generalized to a higher-level entity called PERSON as shown in Figure 1. In this case, common
attributes like P_NAME, and P_ADD become part of a higher entity (PERSON), and
specialized attributes like S_FEE become part of a specialized entity (STUDENT).
Generalization is also called as ‘ Bottom-up approach”.

Generalization

Specialization
In specialization, an entity is divided into sub-entities based on its characteristics. It is a top-down approach
where the higher-level entity is specialized into two or more lower-level entities. For Example, an
EMPLOYEE entity in an Employee management system can be specialized into DEVELOPER, TESTER,
etc. as shown in Figure 2. In this case, common attributes like E_NAME, E_SAL, etc. become part of a
higher entity (EMPLOYEE), and specialized attributes like TES_TYPE become part of a specialized entity
(TESTER).
Specialization is also called as ” Top-Down approch”.

25
Specialization
Inheritance: It is an important feature of generalization and specialization
Attribute inheritance : It allows lower level entities to inherit the attributes of higher level entities and
vice versa. In diagram Car entity is an inheritance of Vehicle entity ,So Car can acquire attributes
of Vehicle. Example:car can acquire Model attribute of Vehicle.
Participation inheritance: Participation inheritance in ER modeling refers to the inheritance of
participation constraints from a higher-level entity (superclass) to a lower-level entity (subclass). It ensures
that subclasses adhere to the same participation rules in relationships, although attributes and relationships
themselves are inherited differently. In diagram Vehicle entity has an relationship with Cycle entity, but it
would not automatically acquire the relationship itself with the Vehicle entity. Participation inheritance
only refers to the inheritance of participation constraints, not the actual relationships between entities.

Example of Relation

Aggregation
An ER diagram is not capable of representing the relationship between an entity and a relationship which may be
required in some scenarios. In those cases, a relationship with its corresponding entities is aggregated into a
higher-level entity. Aggregation is an abstraction through which we can represent relationships as higher-level
entity sets.
For Example, an Employee working on a project may require some machinery. So, REQUIRE relationship is
26
needed between the relationship WORKS_FOR and entity MACHINERY. Using aggregation, WORKS_FOR
relationship with its entities EMPLOYEE and PROJECT is aggregated into a single entity and relationship
REQUIRE is created between the aggregated entity and MACHINERY.

Aggregation

conceptual design with the ER model:


Conceptual database design is the process of identifying the essential data elements, relationships,
and constraints in a data model, which represents a particular organization's business requirements. The
conceptual design stage is the first step in the database design process, which precedes the logical and physical
design stages. In this article, we will discuss the conceptual database design, its objectives, its process, and the
key components of a conceptual data model.

Objectives of Conceptual Database Design


The primary objective of conceptual database design is to create a high-level data model that reflects the
business requirements and provides a clear understanding of the data elements, relationships, and constraints
involved. This data model serves as a blueprint for the logical and physical database design stages. The key
objectives of conceptual database design are as follows −
Identify the entities and their attributes − Entities are objects or concepts that exist in the real world and can
be distinguished from each other. Attributes are the properties or characteristics of the entities. The first
objective of conceptual database design is to identify the entities and their attributes that are relevant to the
organization's business requirements.
Define the relationships − Relationships are the associations between entities. The second objective of
conceptual database design is to define the relationships between the identified entities. Relationships can be
one-to-one, one-to-many, or many-to-many.
Establish the constraints − Constraints are the rules that govern the relationships between entities. The third
objective of conceptual database design is to establish the constraints between entities, which ensure data
consistency and integrity.
27
Process of Conceptual Database Design
The process of conceptual database design involves the following steps −
Requirements gathering The first step in conceptual database design is to gather the business requirements
from the stakeholders. This involves identifying the data elements, relationships, and constraints that are
essential to the organization's business requirements.
Entity-relationship modeling The second step in conceptual database design is to create an entity-relationship
(ER) model, which represents the entities, attributes, and relationships between the entities. The ER model is a
graphical representation of the data elements and their relationships.
Normalization − The third step in conceptual database design is to normalize the ER model, which ensures that
the data is organized efficiently and reduces data redundancy
Review and feedback − The fourth step in conceptual database design is to review the ER model with the
stakeholders and incorporate their feedback into the design.

Explore our latest online courses and learn new skills at your own pace. Enroll and become a certified expert to
boost your career.

Components of Conceptual Data Model


The key components of a conceptual data model are as follows −
Entities − Entities are objects or concepts that exist in the real world and can be distinguished from each other.
Examples of entities include customers, orders, products, and employees.
Attributes − Attributes are the properties or characteristics of the entities. Examples of attributes include name,
address, date of birth, and product code.
Relationships − Relationships are the associations between entities. Examples of relationships include a
customer placing an order, an employee managing a department, and a product belonging to a category.
Cardinality − Cardinality is the number of instances of an entity that can be associated with instances of
another entity. Examples of cardinality include one-to-one, one-to-many, and many-to-many relationships.
Constraints − Constraints are the rules that govern the relationships between entities. Examples of constraints
include referential integrity, which ensures that a foreign key value in one table matches a primary key value in
another table, and uniqueness, which ensures that a field value is unique within a table.

28
29
30
31

You might also like