0% found this document useful (0 votes)
10 views

DBMS 1st Unit Notes

The document provides a comprehensive overview of Database Management Systems (DBMS), detailing their history, evolution, and various data models. It discusses the advantages of using a DBMS over traditional file systems, including data independence, efficient access, and security features. Additionally, it outlines the architecture of DBMS, types of users, and the roles of key components such as the query processor and storage manager.

Uploaded by

praveench1303
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)
10 views

DBMS 1st Unit Notes

The document provides a comprehensive overview of Database Management Systems (DBMS), detailing their history, evolution, and various data models. It discusses the advantages of using a DBMS over traditional file systems, including data independence, efficient access, and security features. Additionally, it outlines the architecture of DBMS, types of users, and the roles of key components such as the query processor and storage manager.

Uploaded by

praveench1303
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/ 20

Data Base:

It is a collection of data, typically describing the activities of one or more related organizations.

Example : An index in a student data like student id, Bracnh, roll no, year & semister, and attendance in the
college system.

Data Base Management System (DBMS):


It is software designed to assist in maintaining and utilizing large collections of data, and the need for
suchsystems, as well as their use, is growing rapidly.

History of Database Management Systems (DBMS)


The history of Database Management Systems (DBMS) dates back to the early 1960s when computers
beganto be used for data processing. The first commercially available DBMS was the Integrated Data Store
(IDS), developed by Charles W. Bachman at General Electric in the late 1960s. IDS was a hierarchical
DBMS that organized data in a tree -like structure, allowing users to store, retrieve, and manage data in
a structured manner.

Key Milestones in DBMS History

1960s
1960s: Charles Bachman developed the Integrated Data Store (IDS), which was based on a structure,
allowing users to store, retrieve, and manage data in a structured manner.
Late 1960s: IBM developed the Information Management System (IMS), a hierarchical database model . 2

1970s
1970: Edgar F. Codd introduced the relational model, which became the foundation for modern relational databases . 1

1974: The Structured Query Language (SQL) was created . 2

1979: Oracle released the first commercial relational database that used SQL .
2

1980s
1980s: IBM introduced System R, a groundbreaking project that developed techniques for efficient relational database
systems . This led to the creation of SQL/DS and IBM DB2.
1

1986: The Object-Oriented Database System Manifesto was published, promoting the development of object-oriented
databases .2

1990s
1990s: The explosive growth of the World Wide Web led to extensive deployment of databases. Database systems had to
support high transaction-processing rates and web interfaces .
1

1996: PostgreSQL, one of the first open-source relational database management systems, was launched .
2

1998: MySQL, another significant open-source RDBMS, was released . 2

2000s
2000s: The emergence of XML and the associated query language XQuery as a new database technology . This period also
1

saw the growth of open-source database systems like PostgreSQL and MySQL.
2004: The term "NoSQL" gained popularity, leading to a new generation of non-relational, distributed databases . 2

2010s and Beyond


2012: Amazon introduced DynamoDB, a proprietary NoSQL database . 2

2017: Google announced Spanner, a globally distributed database .


2

2020s: Continued development in DBMS technology, with a focus on cloud-native databases, edge databases, and AI
integration for database management .2

Evolution of DBMS Technology


The evolution of DBMS technology has been marked by significant advancements in data storage, retrieval, and
management. From the early hierarchical and network models to the relational model introduced by Edgar Codd, DBMS
technology has continuously evolved to meet the growing demands of data processing and management . The introduction
12

of SQL revolutionized the way data was queried and manipulated, making it easier for users to interact with databases .In 2

recent years, the focus has shifted towards cloud-native databases, edge databases, and the integration of AI and machine
learning for database management . These advancements have enabled organizations to handle large volumes of data more
2

efficiently and securely.


FILE SYSTEMS VERSUS A DBMS
Data Organization: FPS uses various file formats, potentially leading to data redundancy and inconsistency,
whereas DBMS centralizes data, reducing redundancy and ensuring consistency.
Data Access: FPS often relies on manual or application-based methods for data access, while DBMS
offersefficient data retrieval through queries.
Data Independence: FPS lacks data independence, making it challenging to modify data structures. DBMS
provides data independence, facilitating changes to data structures.
Atomicity: FPS does not guarantee the atomicity of transactions, while DBMS ensures transactional
atomicity.
Security and Recovery: FPS typically offers lower data security and lacks data recovery features, whereas
DBMS provides robust data security and backup/recovery options.

ADVANTAGES OF A DBMS
Using a DBMS to manage data has many advantages:
Data independence: Application programs should be as independent as possible from details of data
representation and storage. The DBMS can provide an abstract view of the data to insulate application
code from such details.
Efficient data access: A DBMS utilizes a variety of sophisticated techniques to store and retrieve data
efficiently. This feature is especially important if the data is stored on external storage devices.
Data integrity and security: If data is always accessed through the DBMS, the DBMS can enforce integrity
constraints on the data. For example, before inserting salary information for an employee, the DBMS can
check that the department budget is not exceeded. Also, the DBMS can enforce access controls that
governwhat data is visible to different classes of users.
Data administration: When several users share the data, centralizing the administration of data can offer
significant improvements. Experienced professionals who understand the nature of the data being managed,
and how different groups of users use it, can be responsible for organizing the data representation to
minimize redundancy and for fine-tuning the storage of the data to make retrieval efficient.
Concurrent access and crash recovery: A DBMS schedules concurrent accesses to the data in such a
manner that users can think of the data as being accessed by only one user at a time. Further, the DBMS
protects users from the effects of system failures.
Reduced application development time: Clearly, the DBMS supports many important functions that are
common to many applications accessing data stored in the DBMS. This, in conjunction with the high-level
interface to the data, facilitates quick development of applications. Such applications are also likely to be
more robust than applications developed from scratch because many important tasks are handled by the
DBMS instead of being implemented by the application.

Data Model:
A data model is a collection of high-level data description constructs that hide many low-level storage
details. . Most database management systems today are based on the relational data model. other important
data models include the hierarchical model (e.g., used in IBM s IMS DBMS), the network model (e.g.,
used in IDS and IDMS), the objectoriented model (e.g., used in Objectstore and Versant), and the object-
relational model(e.g., used in DBMS products from IBM, Informix, ObjectStore, Oracle, Versant, and
others).
Relational Data Model
The relational model uses a collection of tables to represent both data and the relationships among those data.
Example : Student data for College.

Hierarchical Model
The Hierarchical Model in DBMS is one of the oldest data models, developed by IBM in the 1950s . in this
model data is organized into a tree-like structure.
Example : Consider the below cricket database system hierarchical model scheme.

Network Model
A data model that allows many-to-many relationships and graph structure.
Example : Network model for a Finance Department. Below we have designed the network model for a Finance
Department:

Object-Relational Model
An Object relational model is a combination of a Object oriented database model and a Relational database
model.
Example : A human being catagoriesed into diffrerent groups based on thier profession
What is Schema?
Basically it is the Skeleton of the database which is created by the attributes and this skeleton is named Schema.
Schema mentions the logical constraints like table, primary key, etc. The schema does not represent the data
type of the attributes.

Example : Customer data to be stored as follows.

the following shows how the data will be stored in storage

Types of Database Schemas


There are 3 types of database schema
Physical Database Schema
A Physical schema defines, how the data or information is stored physically in the storage systems in the
form of files & indices. This is the actual code or syntax needed to create the structure of a database.
Logical Database Schema
The Logical schema describes how the data is stored in the form of tables & how the attributes of a table are
connected. Using ER modelling the relationship between the components of the data is maintained.
View Database Schema
It is a view level design which is able to define the interaction between end-user and database.
Database Schema Designs
There are many ways to structure a database, and we should use the best-suited schema design for creating our
database because ineffective schema designs are difficult to manage & consume extra memory and resources.
Schema design mostly depends on the application's requirements. Here we have some effective schema
designs to create our applications, let's take a look at the schema designs:
Flat Model: A flat model schema is a 2-D array in which every column contains the same type of data.
Example : Collage student DB.

Hierarchical Model: Data is arranged using parent-child relationships.


Example : electronics store inventory

Network Model: The network model and the hierarchical model are quite similar with an important difference
that is related to data relationships.
Example : Project Database for an organization.

Relational Model: The relational model is mainly used for relational databases, where the data is stored as
relations of the table.
Example : simple Student DB
Star Schema: Star schema is better for storing and analyzing large amounts of data. It has a fact table at its
center & multiple relational models connected to it just like a star.
It can be said to be

Snowflake Schema: Just like star schema, the snowflake schema also has a fact table at its center and multiple
dimension tables connected to it, but the main difference in both models is that in snowflake schema
dimension tables are further normalized into multiple related tables.
We can consider it as a star schema of star schemas with a fact table table for the other fact tables.

Difference between Logical and Physical Database Schema


Database Instance
A database instance consists of all the data actually stored at any point in time within a database.
Database schema versus database instance

Data Independence
A very important advantage of using a DBMS is that it offers data independence. that is, application programs
are insulated from changes in the way the data is structured and stored. Data independence is achieved through
use of the three levels of data abstraction; in particular, the conceptual schema and the external schema
provide distinct benefits in this area.
Data independence is a property of a database management system by which we can change the database
schema at one level of the database system without changing the database schema at the next higher level.
Types of Data Independence
There are two types of data independence.
Logical data independence
Changing the logical schema (conceptual level) without changing the external schema (view level) is called
logical data independence.
Example : It is possible to add or delete new entities, attributes to the conceptual schema without making any
changes to the external schema.
Physical data independence
Making changes to the physical schema without changing the logical schema is called physical data
independence.
Example : Changing the location of the database from C drive to D drive.
3-Tier Architecture in DBMS For Data Independence
The 3-tier architecture is a commonly used architectural approach in Database Management Systems for
the design and development of applications that work with databases. The 3-tier architecture divides an
application's components into three tiers or layers. Each layer has its own set of objectives. They are.,
Physical Level: A t the physical level, the information about the location of database objects in the data
store is kept.
Conceptual Level: At conceptual level, data is represented in the form of various database tables.
External Level: An external level specifies a view of the data in terms of conceptual level tables.
Benefits of 3-Tier Architecture
The 3-tier architecture in DBMS provides several benefits, including:
Scalability: The architecture separates the application processing and data management layers, which
allows for easy scalability of each layer independently.
Flexibility: The architecture allows for the replacement or upgrade of one layer without affecting the other
layers.
Security: The architecture provides an additional layer of security, as the data management tier can be
isolated from the application and presentation tiers, reducing the risk of unauthorized access.
SYSTEM USERS
four different types of database-system users,
1. Application programmers
2. Sophisticated users and Specialized users:-
3. Database Administrator
4. Naive users
1. Application programmers
Computer professionals and write application programs. They interact with the system through DML
calls. DML calls are embedded in a program written in a host language (for example PHP, python, c).
These programs are commonly referred to as application programs.
2. Sophisticated users and Specialized users
Sophisticated users interact with the system without writing programs. They request in a database
query language as query form. Each query is submitted to a query processor. Query processor is to
break down DML statements into instructions that the storage manager understands. They work as an
analyst.
Specialized users are sophisticated users who write specialized database applications like computer-
aided design Systems, knowledgebase, and expert systems, etc. The user uses complex data types (for
example, graphics data and audio data).
3. Database Administrator (DBA)
DBA has central control over the system. Responsible for following functions:
(i) Schema Design and Maintenance,
(ii) Physical Schema and Organization Modification,
(iii) Authorization and Security,
(iv) Integrity Constraint Specification,
(v) Recovery from Failure,
(vi) Database Upgradation
4. Naive users
Naive users are unsophisticated users. Interact with the system by the permanent application
programs that have been written previously. For example, the clerk at the ticket booking window, he
uses an application program to do his job of making reservations for a passenger.

Data Base System Structure

The following is a simple illistration of the Data Base System


Detailed Arcihetecture of BDS
Now let use see what each of the DBMS components dose.
the main DBS is devided into three parts that are as illistrated in simple figure.

now when we come to the DBMS there are two individual components that are furthermore
composed of vareous modules. the main two compnents are.,.
1. Query Processor
2. Storage Manager
1. Query Processor: Query Processor Components: -
These components are used in evaluating DDL and DML queries. These are:-
(i) DDL Interpreter: Interprets DDL statements and store the definitions in the data dictionary, as
metadata.
(ii) DML Queries: Sophisticated or Specialized user s requests in a database query language.
Each query is submitted to a query tools Query tools break down it into DML queries and low-
level instructions. These are sent to the DML compiler and Organizer, and the query evaluation
engine for further processing.
(iii) DML Compiler and Organizer: DML calls are usually started by a special character/code so
that the appropriate code can be generated.
A special preprocessor, called the DML precompiles, converts the DML statement to
normal procedure calls in the host language. The resulting program is then run through the host-
language compiler, which generates appropriate object code ( a set of low-level instructions that
canbe used by query evaluation engine.). The DML compiler also performs query optimization,
thatis,it picks the lowest cost evaluation plan from among the alternatives.
(iv) Application Program Object Code: It converts DML statements embedded in an application
program to normal procedure calls in the host language. These pre-compilers consult the DML
compiler to generate the appropriate code.
(v) Compiler and Linker: Application programmer writes program application. The source codes
compiled by the compiler and linker-linked application program object code to DML queries and
send to query evolution engine.
(iv) Query evaluation Engine: A query can usually be translated into any of a number of alternative
evaluation plans that all give the same result. This component is responsible for interpreting and
executing the SQL query.
It contains three major components
Compiler - builds a data structure from the SQL statement and then does semantic checking on the
query such as whether the 'table' exists, 'field' exists, etc.
Optimizer - transforms the initial query plan (data structure created by the compiler), into the
sequence of operations usually pipelined together to achieve fast execution. It refers to the metadata
(dictionary) and statistical information stored about the data to decide which sequence of
operations is likely to be faster and based on that it creates the optimal query plan. Both cost and
rule-based optimizers are used.
Execution Engine - executes each step in the query plan chosen by Optimizer. It interacts with the
relation engine to retrieve and store records.
2. Storage Manager: A storage manager is a program module that provides the 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 the interaction with the file manager. The raw
-data are stored on the disk using the file system, which is usually provided by a inventional
operating system. The storage manager translates the various DML statements into low-level file
system commands.The storage manager is responsible for storing, retrieving, and updating data in the
database. A large amount of storage space is required for storing corporate databases (which may
range from hundreds to gigabytes to terabytes of data) and to manage this storage manager is required.
Data are to move between disk storage and main memory as per requirement because the main
memory of the computer cannot store this much information.
The storage manager components
(i) File Manager: It manages disk space allocation and the data structures used to store the data.
Filemanager maps disk pages of the file to the memory pages at the disk in physical form and does
the actual disk I/O operations in case of major faults generated "by buffer manager module.
(ii) Buffer Manager: Buffer manager responsible for loading pages(fetching) from disk to main
memory and to managing the buffer pool based on Least Recently Used (LRU) algorithm and
deciding the caching strategy suitable for the application. It is a critical part of the database system,
it enables the database to handle data sizes that are much large than the size of main memory for
this has a special-purpose allocator for storing control information, which is transient. Buffer pool
is the memory space used by buffer manager to cache disk pages associated with records, index
information, Metadata information. Some database systems have space limits at the individual level
and some at the global level for buffer pool size.
(iii) Transaction Manager: The transaction manager creates transaction objects and manages their
atomicity and durability. Applications request the creation of a transaction object by calling the
transactions manager's begin Transaction method. When a resource manager first participates in a
transaction, it calls the Enlist method to enlist in the transaction. The transaction manager tracks all
the resource managers who enlist in the transaction. It ensures that the database remains in a
consistent (correct) state despite system failures and that concurrent transaction executions proceed
without conflict. One of the following three results can occur:
1. The application either commits or aborts the transaction.
2 . A resource manager aborts the transaction.
3. A failure occurs.
(iv) Authorization and Integrity Manager: This manager is responsible for granting access to the
database or portions thereof only to authorized users and preventing access to unauthorized users. It
tests for the satisfaction of integrity constraints and checks the authority of users to access data. It
uses all the integrity constraints and authorization rules specified by the DBA. Integrity manager
must assure data integrity during normal database operations as well as during the database failures.
Disk Storage
A DBMS can use several kinds of data structures as a part of physical system implementation in
the form of disk storage. Each structure has its own importance.
Following are some common data structures.
Disk storage is the central repository for storing all kinds of data in the database.
(i) Data: It stores the database itself on the disk in the Data files.
(ii) Data Dictionary: Information relating to the structure and usage of data contained in the
database, the metadata, is maintained in a data dictionary. The data dictionary is a database itself,
documents the data. Each database user can consult the data dictionary to pick up what each piece
of data and the various synonyms of the data fields mean. In a system the data dictionary is part of
the DBMS (Integrated system) the data dictionary stores information concerning the source of each
data-field value, the frequency of its use, and an audit trail (verification of account) concerning
updates, including the who and when of each update. Currently data dictionary systems are
available as add-ons to the DBMS.
The data dictionary stores:
- Names of relations
- Names of the attributes of each relation
- Domains, and lengths of attributes
- Names of views defined on the database, and definitions of those views
- Names of authorized users
- Accounting information about users
- Number of tuples in each relation
- Method of storage used for each relation
- Name of the index
- Name of the relation being indexed
- Attributes on which the index is defined
- Type of index formed
(iii) Indices: Indices, which can provide fast access to data items. A database index provides
pointers to those data items that hold a particular value. Hashing is an alternative to indexing that is
faster in some but not all cases.
(iv) Statistical Data: It stores statistical information about the data stored in the database, like the
number of records, blocks, etc. in a table. This information can be used to execute a query
efficiently.
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 Compiler: It processes the DDL statements into a set of table containing meta data (data about
data). that are stored in Data Dictionary manager.
Embedded DML Pre-compiler: It processes DML statements embedded in an application program
into procedural calls.

2. Storage Manager: Storage Manager is a program that provides an interface between the data
storedin 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.
Query Optimizer: transforms the initial query plan (data structure created by the compiler), into the
sequence of operations usually pipelined together to achieve fast execution.
Command Processor: executes each step in the query plan chosen by Optimizer. It interacts with the
relation engine to retrieve and store records.
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
beforeand after the execution of a transaction.
Data 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.
Recovery Manager: It usally is resposible for data recovery and maintain data recovery meta data.
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.
Database Environment:
A database environment is a collective system of components that comprise and regulates the group of data,
management, and use of data, which consist of the following
1. software,
2. hardware,
3. people,
4. techniques of handling database, and
5. the data (also).
Here,
1. Software means the whole thing right from the operating system (OS) to the application programs that include
database management software like M.S. Access or SQL Server oracle DB server, etc.,..
2. Hardware in a database environment means the computers and computer peripherals that are being used to
manage a database.
3. People in a database environment include those people who administrate and use the system.
4. Techniques are the rules, concepts, and instructions given to both the people and the software.
finally
5. Data with the group of facts and information positioned within the database environment.
Client - Server Architecture
Entity Relationship Model
Introduction of ER Model :
The Entity Relationship Model is a model for identifying entities to be 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.The Entity Relationship Diagram explains the
relationship among the entities present in the database. ER models are used to model real-world objects like a
person, a car, or a company and the relation between these real-world objects. In short, the ER Diagram is the
structural format of the database.
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 and no hardware support.
-> These diagrams are very easy to understand and easy to create even for a naive user.
-> 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.
>> Double Rectangle: Double Rectangle represents a Weak Entity.

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:
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 .
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 is Strong Entity Type for Dependent. This is represented diagramatically as follows.,.

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.
Types of Attributes
1. Key Attribute
The attribute which uniquely identifies each entity in the entity set is called the key attribute. For example,
Employee ID. will be unique for each Employee. In ER diagram, the key attribute is represented by an oval
with underlying lines.

Attribute Example: Emp-ID

2. Composite Attribute
An attribute composed of many other attributes is called a composite attribute. For example, the Name
attribute of the Employee Entity type consists of first name, middle name, and last name. In ER diagram,
the composite attribute is represented by an oval comprising of ovals.

L-Name F-Name M-Name

Name

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 Employee). In ER diagram, a multivalued attribute is represented by a double oval.

Phone-No.

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.

Age
Let use now see the considered example for the entity Employee in ER diagram reprasantation.

Employee

DOB

Emp_ID Name Age Phone No.

F-Name M-Name L-Name

What is Relationship?
The relationship is the Connection of Dependency or Assosiation between the entities.
Example: The Employee has a relationship of "works for " with the Department of an organization.
The relationship is reprasented by "Diamond".

Employee works for Department

Types of Relations ships:


There are three primary types of relationships in a database: three potential forms. i.e.,
1) one to one.
2) one to many., and
3) many to many.
1. One to One Relationshop: This is a relationship between two entites where one entity attribute set
isrelated to another only one attribute set in another entity
Example: the employee of an organization works in only one department.
2. One to Many/ Many to One Realtionship: This can be reprasented as one attribute set of an entity
being related to many attribute sets in another entity. this relationship can happen in either directions.
Examples:
a) The employee of an organization can interact with different Departments.
b) An athelete can participate in many sports catagories.i.e., a runner can participate in 100 m,
200 m, 400 m, 800 m, relay race, and marathon.
c) An oragnization can allocate multiple teams under one manager.
3. Many to Many Relationship: This is a relationship that combines the one to many relations in both
directions.
Examples:
a) A team can get assigned to multiple projects while same project being handled by multiple
teams.
b) An event can be organized with differnent activities deing managed by differnent co-ordianters.
i.e.,cricket, kabadi and batmenton have empires who can empire in two more games.
ES1 ES2 ES1 ES2 ES1 ES2

E1 E1 E1 E1 E1 E1

E2 E2 E2 E2 E2 E2

E3 E3 E3 E3 E3 E3

One to One Relationship One to Many Relationship Many to Many Relationship


Why are Relationships Important in a Database?
Relationships are crucial in a database for several reasons:
Data Integrity: The relationships make the necessary links between data sets and ensure that
information kept and joined together is accurate. In this way, the consistency and correctness of the
data are maintained.
Efficient Data Retrieval: The relationship permits the complete search of data among multiple tables,
storing fewer inputs and executing the query quickly, respectively.
Normalization: Relations remain priorities that ensure the sync of data and achieving a level of
relevance.
Complex Data Analysis: Relationships empower users for state-of-the-art querying, aggregation, and
analysis; thereby, users would be deriving meaningful insights from their data.
Scalability: It has turned out that well-defined relationships, in their turn, are the key issue that helps
the database to be scalable, thus having a structure that is easy to manage and could be further
adapted to possible expanding business needs.
What is a Relationship Set?
A relationship set in a Database Management System (DBMS) is a collection of relationships of the
same type.It represents the associations between different entities in a database. These relationships
are crucial for organizing, storing, and retrieving data efficiently
Characteristics of Relationship Sets
Degree: The degree of a relationship set refers to the number of entity sets that participate in the
relationship. For example, a binary relationship set involves two entity sets, while a ternary
relationship set involves three, and N-ary involves many reationships.
Arity: Arity indicates the number of participating relations. It can be binary (two relations), ternary
(three relations), etc.
Cardinality: Cardinality defines the number of instances or records that can be associated with each
entity on both sides of the relationship. This allows for different types of connections, such as one-to-
one, one-to-many, and many-to-many.
Types of Relationship Sets
Unary Relationship Set: Involves only one entity set. For example, a person is married to only one
person.
Binary Relationship Set: Involves two entity sets. For example, a student is enrolled in a course.
Ternary Relationship Set: Involves three entity sets.
N-ary Relationship Set: Involves 'n' entity sets.
Importance of Relationship Sets
Understanding and properly defining relationship sets is essential for designing a well-structured and
functional database system. It ensures accurate representation and management of data, supporting
complex data recovery operations and maintaining data integrity.

What is a Constraint?
Constraints in Database Management Systems (DBMS) are rules or conditions applied to the data
within a database to ensure data integrity, consistency, and adherence to business rules.
Types of Constraints in DBMS

Domain Constraints: Domain constraints specify the permissible values for a given attribute.
Example: a column for student age can only contain numeric values.
Tuple Uniqueness Constraints: This constraint ensures that all rows in a table are unique. No two
rows can have the same values for all columns simultaneously.
Example: a roll number of student must be unique.
Key Constraints: A primary key must be unique and cannot be null. all the attributes can not be
primary keys. Key constraints are applied to attributes that are considered primary keys.
Example: a roll number of student must be unique and never be null to consider it as primary key.
Entity Integrity Constraints: Entity integrity constraints state that primary key attributes must not
contain null values. This is crucial because primary keys are used to uniquely identify rows in a
table.
Example: a roll number of student must be unique and never be null.
Referential Integrity Constraints:Referential integrity constraints ensure the consistency and
accuracy of data between related tables. This is achieved through the use of primary and foreign
keys. A foreign key in one table must match a primary key in another table
Example: the depatment id is a foreign key in student table.
Importance of Constraints
Constraints are essential in DBMS as they enforce data integrity, maintain data consistency, and
prevent data anomalies. They ensure that the data within a database adheres to predefined
standards and business rules, guaranteeing the accuracy, reliability, and validity of the data.
Constraints can be modified or removed using appropriate SQL statements or DBMS
management tools. However, caution should be exercised to avoid unintended consequences or
data inconsistencies.
Subclasses: A subclass is a class derived from the superclass. It inherits the properties of the superclass and also
contains attributes of its own.
Example: Car, Truck and Motorcycle are all subclasses of the superclass Vehicle. They all inherit common
attributes from vehicle such as speed, colour etc. while they have different attributes also i.e Number of
wheels in Car is 4 while in Motorcycle is.

Superclasses: A superclass is the class from which many subclasses can be created. The subclasses inherit the
characteristics of a superclass. The superclass is also known as the parent class or base class.
Example: Vehicle is the Superclass and its subclasses are Car, Truck and Motorcycle in the above
illistration.
Inheritance: Inheritance is basically the process of basing a class on another class i.e to build a class on a
existing class. The new class contains all the features and functionalities of the old class in addition to its own.
The class which is newly created is known as the subclass or child class and the original class is the parent
class or the superclass.
Example: The above illistration is the inheritance of vehicle to car or truck or motorcycle.
Specialization: Specialization is the process of identifying subsets of an entity set (the superclass) that share
some distinguishing characteristic. Typically, the superclass is defined first, the subclasses are defined next,
and subclass-specific attributes and relationship sets are then added.
Example: The above illistration car or truck or motorcycle are the specilizations of vehicle.
Generalization: It is the process of combining similar entity sets in to one. Generalization is like a bottom-
upapproach in which two or more entities of lower level combine to form a higher level entity if they
have some attributes in common.
Example: The above illistration car or truck or motorcycle are generalized as vehicle.
ER Model Examples:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy