0% found this document useful (0 votes)
46 views88 pages

Introduction To Data Base Mangement

introduction to data base mangement

Uploaded by

bunny.19.178
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)
46 views88 pages

Introduction To Data Base Mangement

introduction to data base mangement

Uploaded by

bunny.19.178
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/ 88

UNIT-1

INTRODUCTION TO DBMS
TOPICS TO DISCUSS
➢ Overview of DBMS
➢ File system versus a DBMS
➢ Advantages of a DBMS
➢ Three Schema architecture of DBMS
➢ Data Models
➢ Database Languages
➢ Transaction Management
➢ Structure of a DBMS
➢ Client/Server Architecture
➢ Database Administrator and Users
OVERVIEW OF DBMS
A Database Management System (DBMS) is a
software system that is designed to manage
and organize data in a structured manner.
It allows users to create, modify, and query a
database, as well as manage the security and
access controls for that database.
Needs Definition of 3 Terms
➢ Data
➢ Information
➢ Database
➢ DBMS

Data: are the raw facts collected for processing (or) unprocessed
raw information
In simple terms:
➢ Raw facts
➢ Unprocessed raw information
➢ Stored in database or file
➢ Unorganized
Information: Processed data are called as information (or)
processed outcome of data.
In simple terms:
Processed data
Organized / arranged data
Refers to that are concerned with particular entities.

Types of Data:
Quantitative Data: refers to data that are strictly numbers
Qualitative Data: refers to data that are expressed in categorical
Database:
➢ It is organized collection of data
➢ Database or D/B is organized in various models for every
processing

DBMS (or) Data Base Management System:


It is software system designed to allow:
➢ Definition
➢ Creation
➢ Querying
➢ Update
➢ Administration of database
DBMS is responsible for maintaining the integrity and security of stored data,
and for restoring information if system fails.
DBMS provides an environment i.e., both convenient and efficient to use

Various DBMS S/W:


➢ MySQL
➢ Oracle
➢ Microsoft SQL server
➢ IBM DB2
➢ SQLite
➢ MongoDB
➢ Elasticsearch
A DBMS is a collection of programs which acts as an
intermediate between the user and the database. It is used in
various real time applications

Various applications using DBMS are:


➢ Super Market Product Inventory System
➢ Stock Trading Systems
➢ Computerized Library Systems
➢ Client- server Applications
➢ Flight Reservation Systems
➢ Computerized Library Systems
File system versus a DBMS
File System:
In computing, a File system is used to control how information is
stored and retrieved.
Without File System, information placed in a storage area would
be one large body of information.
So information can be separated into individual pieces. Giving
each piece a name, information easily be separated.
In simple term:
The structure and logic of rules used to manage the group of
information and their names is called “FILE SYSTEM”
File system use different kinds of storage devices to store data.
Examples of File System:
➢ Hard Drive
➢ Magnetic Disk
➢ Optical Disk
➢ Flash Memory
File System DBMS
File System DBMS
DBMS was developed to handle various difficulties of File
processing system in simple terms

Data Redundancy & Inconsistency


Difficulty in accessing the data
Data Isolation
Integrity problem
Atomicity
Concurrent Access by Multiple users
Security Problems
Advantages of DBMS
➢ Data integrity: To avoid data mistakes and
inconsistencies, database management systems
(DBMSs) apply data integrity requirements including
referential integrity, entity integrity, and domain
integrity. This guarantees the consistency, accuracy,
and completeness of the data.
➢ Reduced Data Redundancy: DBMS eliminates data
redundancy by storing data in a structured way. It
allows sharing data across different applications and
users, reducing the need for duplicating data.
➢ Improved Data Consistency: DBMS ensures data
consistency by enforcing data validation rules and
constraints. This ensures that data is accurate and
consistent across different applications and users.
➢ Improved Data Access and Availability: DBMS provides
efficient data access and retrieval mechanisms that
enable quick and easy data access. It allows multiple
users to access the data simultaneously, ensuring data
availability.
➢ Data security: To prevent illegal access, alteration, or
theft, database management systems (DBMS) include a
number of security features, including encryption,
authentication, and authorization. Sensitive data is
safeguarded against both internal and external attacks
thanks to this.
➢ Improved Data Integration: DBMS allows integrating
data from different sources, providing a comprehensive
view of the data. It enables data integration from
different systems and platforms, improving the quality
of data analysis.
➢ Improved Data Backup and Recovery: DBMS provides
backup and recovery mechanisms that ensure data is
not lost in case of a system failure. It allows restoring
data to a specific point in time, ensuring data
consistency.
➢ Data sharing: DBMSs prevent conflicts and data loss by
enabling numerous people to view and edit the same
data at once. This promotes teamwork and enhances
data uniformity throughout the company.
➢ Data independence: By separating the logical and
physical views of data, database management systems
(DBMS) enable users to work with data without being
aware of its exact location or structure. This offers
adaptability and lowers the possibility of data damage
as a result of modifications to the underlying hardware
or software.
Three Schema architecture of DBMS
or
Levels of Data Abstraction
➢ The three schema architecture is also called ANSI/SPARC architecture or
three-level architecture.
➢ This framework is used to describe the structure of a specific database
system.
➢ The three schema architecture is also used to separate the user
applications and physical database.
➢ The three schema architecture contains three-levels. It breaks the
database down into three different categories.
(or)
The Major purpose of the D/B system is to provide users with abstract view of
data i.e., system hides how data stored and maintained
The three-schema architecture
In the above diagram:
➢It shows the DBMS architecture.
➢Mapping is used to transform the request and
response between various database levels of
architecture.
➢In External / Conceptual mapping, it is
necessary to transform the request from
external level to conceptual schema.
➢In Conceptual / Internal mapping, DBMS
transform the request from the conceptual to
internal level.
The main objective of three level architecture is to enable
multiple users to access the same data with a personalized
view while storing the underlying data only once. Thus it
separates the user's view from the physical structure of the
database.
This separation is desirable for the following reasons:
➢ Different users need different views of the same data.
➢ The approach in which a particular user needs to see the
data may change over time.
➢ The users of the database should not worry about the
physical implementation and internal workings of the
database such as data compression and encryption
techniques, hashing, optimization of the internal structures
etc.
➢ All users should be able to access the same data according
to their requirements.
Internal Level/ Physical Level/ Lowest level:
➢ The internal level has an internal schema which describes the
physical storage structure of the database.
➢ The internal schema is also known as a physical schema.
➢ It uses the physical data model. It is used to define that how
the data will be stored in a block.
➢ The physical level is used to describe complex low-level data
structures in detail.
Conceptual Level/ Logical Level/ Next higher
Level:
➢ The conceptual schema describes the design of a database at the
conceptual level. Conceptual level is also known as logical level.
➢ The conceptual schema describes the structure of the whole database.
➢ The conceptual level describes what data are to be stored in the
database and also describes what relationship exists among those data.
➢ In the conceptual level, internal details such as an implementation of the
data structure are hidden.
➢ Programmers and database administrators work at this level.
External Level/ View Level/Highest Level:
➢ At the external level, a database contains several schemas
that sometimes called as subschema. The subschema is used
to describe the different view of the database.
➢ An external schema is also known as view schema.
➢ Each view schema describes the database part that a
particular user group is interested and hides the remaining
database from that user group.
➢ The view schema describes the end user interaction with
database systems.
Data Models
➢ Data Model can be defined as an integrated collection of concepts for
describing and manipulating data, relationships between data, and
constraints on the data in an organization.
(or)
➢ Data Model is a logical structure of Database. It describes the design of
database to reflect entities, attributes, relationship among data,
constrains etc.

Types of Data Models:


➢ Object Based Logical Model
E-R Model
Object Oriented Model
➢ Record Based Logical Model
Relational Model
Hierarchical Model
Network Model
➢ Physical Data Model
Object Based Logical Model
➢ It describe data at the conceptual and view levels.
Two Types:
→ ER Model
→ Object Oriented model

Entity- Relationship Model (ER Model):


➢ An Entity–relationship model (ER model) describes the
structure of a database with the help of a diagram, which is
known as Entity Relationship Diagram (ER Diagram).
➢ An ER model is a design or blueprint of a database that can
later be implemented as a database.
➢ The main components of E-R model are: entity set and
relationship set.
A Simple E-R Diagram

Rectangle: Represents Entity sets.


Ellipses: Attributes
Diamonds: Relationship Set
Lines: They link attributes to Entity Sets and Entity sets to
Relationship Set
Double Ellipses: Multivalued Attributes Ex: Phone_no, Email_id
Dashed Ellipses: Derived Attributes Ex: age from date of birth
Double Rectangles: Weak Entity Sets
Double Lines: Total participation of an entity in a relationship set
Object Oriented Model
➢ Object oriented data model is also based on using real life
scenarios. In this model, the scenarios are represented as
objects. The objects with similar functionalities are grouped
together and linked to different other objects.

An Example of the Object Oriented data model is −


➢ PERSON and EMPLOYEE are 2 objects in this model.
➢ PERSON has the attributes Name, Address, Age and Phone
number.
➢ EMPLOYEE has the attributes Employee ID, Employee Type
and Department ID
The object EMPLOYEE inherits data from the object PERSON i.e
the attributes for PERSON would also be available for
EMPLOYEE.
Record based logical Models
➢ Like Object based model, they also describe data at the
conceptual and view levels. These models specify logical
structure of database with records, fields and attributes

Three Types :
➢ Relational Model
➢ Hierarchical Model
➢ Network model
Relational Model:
➢ In relational model, the data and relationships are
represented by collection of inter-related tables.
➢ Each table is a group of column and rows, where column
represents attribute of an entity and rows represents records.

Sample relationship Model: Student table with 3 columns and


four records.
Hierarchical Model:
➢ The data is organized into a tree like structure with each
record is having one parent record and many children.
➢ The main drawback of this model is that, it can have only one
to many relationships between nodes.
Sample Hierarchical Model Diagram:
Network Model
➢ Network Model is same as hierarchical model except that it
has graph-like structure rather than a tree-based structure.
➢ Unlike hierarchical model, this model allows each record to
have more than one parent record.
Physical Data Models –
➢ These models describe data at the lowest level of abstraction.
➢ The following physical data model examples are derived from the logical data
model examples.
➢ It is worth noting that while logical data models serve as blueprints for physical
data models, their attributes and names do not have to be the same as physical
data model tables and columns.
Structure of DBMS
➢ The structure includes the components and programs which
work under DBMS
➢ while architecture includes the various entities present in the
DBMS and how user interaction is done with the database.
➢ There are four major components of the structure of DBMS.

These components are


➢ Users
➢ Query Processor
➢ Storage Manager
➢ Disk Storage
Fig: Structure of DBMS
Query Processor:
➢ The Query Processor receives the queries (requests) from the user
and interprets them in the form of instructions.
➢ It also executes the instructions received from the DML Compiler.

It has 4 components:

➢ DML Compiler: It converts the DML (Data Manipulation Language)


Instructions into Machine Language (low-level language).
➢ DDL Interpreter: It interprets the DDL (Data Definition Language)
Instructions and stores the record in a data dictionary (in a table
containing meta-data)
➢ Query Optimizer: It executes the DML Instructions and picks the
lowest cost evaluation plan out of all the alternatives present.
➢ Embedded DML Pre-compiler: It translates the DML statements
embedded in Application Programs into procedural function calls.
Storage Manager:
➢ Storage manager acts as the interface between the data stored in the
database and the queries received from the end-user.
➢ This component in the Structure of DBMS is responsible for the constraints
applied to the data so that it remains consistent.
➢ It also executes the DCL (Data Control Language).

Components:

➢ Authorization and Integrity Manager: It checks the authority of various


users who access data and the Integrity Constraints of the database.
➢ Transaction Manager: Its job is to assure the system remains in a proper
state during the transaction process. It also ensures that concurrent
transactions are executed without any conflict.
➢ File Manager: It manages the space allocation of files in disk and data
structures which stores information in the database.
➢ Buffer Manager: It manages the transfer of data between the secondary
and main memory. It also decides what data should be cached in the
memory.
Disk Storage:
The Disk Storage in the Structure of DBMS represents the space
where data is stored.
It has the following components:
➢ Files: These are responsible for storing the data.
➢ Data Dictionary: It is the repository that maintains the
information of the database object and maintains the
metadata.
➢ Indices: These are the keys that are used for faster retrieval of
data.
Database Languages
• A DBMS has appropriate languages and interfaces to express
database queries and updates.
• Database languages can be used to read, store and update the
data in the database.
Data Definition Language(DDL)
• DDL stands for Data Definition Language. It is used to define
database structure or pattern.
• It is used to create schema, tables, indexes, constraints, etc. in
the database.
• Using the DDL statements, you can create the skeleton of the
database.
• Data definition language is used to store the information of
metadata like the number of tables and schemas, their
names, indexes, columns in each table, constraints, etc.
Here are some tasks that come under DDL:
➢ Create: It is used to create objects in the database.
➢ Alter: It is used to alter the structure of the
database.
➢ Drop: It is used to delete objects from the database.
➢ Truncate: It is used to remove all records from a
table.
➢ Rename: It is used to rename an object.

These commands are used to update the database


schema that's why they come under Data definition
language.
Data Manipulation Language (DML)
➢ DML stands for Data Manipulation Language.
➢ It is used for accessing and manipulating data in a database. It
handles user requests.

Here are some tasks that come under DML:

➢ Select: It is used to retrieve data from a database.


➢ Insert: It is used to insert data into a table.
➢ Update: It is used to update existing data within a table.
➢ Delete: It is used to delete all records from a table.
Data Control Language (DCL)
➢DCL stands for Data Control Language. It is
used to retrieve the stored or saved data.

• Here are some tasks that come under DCL:


➢ Grant: It is used to give user access privileges to a
database.
➢ Revoke: It is used to take back permissions from the user.
Transaction Control Language (TCL)
TCL is used to run the changes made by the DML
statement.
TCL can be grouped into a logical transaction.

Here are some tasks that come under TCL:


➢ Commit: It is used to save the transaction on the
database.
➢ Rollback: It is used to restore the database to original
since the last Commit.
Transaction Management
➢ Transactions are a set of operations used to perform a logical set of work.
➢ It is the bundle of all the instructions of a logical operation.
➢ A transaction usually means that the data in the database has changed.
➢ One of the major uses of DBMS is to protect the user’s data from system
failures.
➢ It is done by ensuring that all the data is restored to a consistent state when
the computer is restarted after a crash.
➢ The transaction is any one execution of the user program in a DBMS.
➢ One of the important properties of the transaction is that it contains a finite
number of steps.
➢ Executing the same program multiple times will generate multiple
transactions.
Example: Consider the following example of
transaction operations to be performed to
withdraw cash from an ATM.
Steps for ATM Transaction
➢ Transaction Start.
➢ Insert your ATM card.
➢ Select a language for your transaction.
➢ Select the Savings Account option.
➢ Enter the amount you want to withdraw.
➢ Enter your secret pin.
➢ Wait for some time for processing.
➢ Collect your Cash.
➢ Transaction Completed.
A transaction can include the following basic database access
operation.
➢ Read/Access data (R): Accessing the database item from disk
(where the database stored data) to memory variable.
➢ Write/Change data (W): Write the data item from the
memory variable to the disk.
➢ Commit: Commit is a transaction control language that is used
to permanently save the changes done in a transaction
Example: Transfer of 50₹ from Account A to Account B. Initially
A= 500₹, B= 800₹. This data is brought to RAM from Hard
Disk.

➢ R(A) -- 500 // Accessed from RAM.


A = A-50 // Deducting 50₹ from A.
W(A)--450 // Updated in RAM.
R(B) -- 800 // Accessed from RAM.
B=B+50 // 50₹ is added to B's Account.
W(B) --850 // Updated in RAM.
commit // The data in RAM is taken back to Hard Disk.
Client-Server Architecture
➢ A client-server architecture for DBMS is one in which data is
stored on a central server, but clients connect to that server in
order to access and manipulate the data.
➢ As the number of clients and/or the amount of data increases,
the server can be upgraded or additional servers can be
added to handle the load. This allows the system to continue
functioning smoothly even as it grows in size.
➢ Client-server architecture is that it is more fault-tolerant. If a
single server goes down, other servers can take over its
responsibilities, and clients can still access the data. This
makes the system less likely to experience downtime, which is
a crucial factor in many business environments.
Architectures
1-Tier Architecture:
➢In this architecture, the database is directly
available to the user. It means the user can
directly sit on the DBMS and uses it.
➢Any changes done here will directly be done
on the database itself. It doesn't provide a
handy tool for end users.
➢The 1-Tier architecture is used for
development of the local application, where
programmers can directly communicate with
the database for the quick response.
2-Tier Architecture:
➢ The 2-Tier architecture is same as basic client-server. In the two-tier architecture,
applications on the client end can directly communicate with the database at the
server side. For this interaction, API's like: ODBC, JDBC are used.
➢ The user interfaces and application programs are run on the client-side.
➢ The server side is responsible to provide the functionalities like: query processing
and transaction management.
➢ To communicate with the DBMS, client-side application establishes a connection
with the server side.
3-Tier Architecture
➢ The 3-Tier architecture contains another layer between the client and server. In
this architecture, client can't directly communicate with the server.
➢ The application on the client-end interacts with an application server which
further communicates with the database system.
➢ End user has no idea about the existence of the database beyond the application
server. The database also has no idea about any other user beyond the application.
➢ The 3-Tier architecture is used in case of large web application.
Database Administrators and Users
➢ Database Administrator (DBA) : Database Administrator (DBA) is a
person/team who defines the schema and also controls the 3 levels
of database.
➢ The DBA will then create a new account id and password for the
user if he/she need to access the database.
➢ DBA is also responsible for providing security to the database and
he allows only the authorized users to access/modify the data base.
➢ DBA is responsible for the problems such as security breaches and
poor system response time.
– DBA also monitors the recovery and backup and provide technical
support.
– The DBA has a DBA account in the DBMS which called a system or
super user account.
– DBA repairs damage caused due to hardware and/or software failures.
– DBA is the one having privileges to perform DCL (Data Control
Language) operations such as GRANT and REVOKE, to allow/restrict a
particular user from accessing the database.
Users: Database users are categorized based up on their
interaction with the database. These are six types of database
users in DBMS.
➢ Naïve Users
➢ System Analyst
➢ Sophisticated Users
➢ Database Designers
➢ Application Programmers
➢ Specialized users
Naive / Parametric End Users : Parametric End Users are the
unsophisticated who don’t have any DBMS knowledge but
they frequently use the database applications in their daily life
to get the desired results. For examples, Railway’s ticket
booking users are naive users.
System Analyst: System Analyst is a user who analyzes the
requirements of parametric end users. They check whether all
the requirements of end users are satisfied.
Sophisticated Users: Sophisticated users can be engineers,
scientists, business analyst, who are familiar with the
database. They can develop their own database applications
according to their requirement. They don’t write the program
code but they interact the database by writing SQL queries
directly through the query processor.
Database Designers : Data Base Designers are the users who design
the structure of database which includes tables, indexes, views,
triggers, stored procedures and constraints which are usually
enforced before the database is created or populated with data.
He/she controls what data must be stored and how the data items
to be related. It is responsibility of Database Designers to
understand the requirements of different user groups and then
create a design which satisfies the need of all the user groups.

Application Programmers : Application Programmers also referred as


System Analysts or simply Software Engineers, are the back-end
programmers who writes the code for the application programs.
They are the computer professionals. These programs could be
written in Programming languages such as Visual Basic, Developer,
C, FORTRAN, COBOL etc. Application programmers design, debug,
test, and maintain set of programs called “canned transactions” for
the Naive (parametric) users in order to interact with database.
Specialized users : Specialized users are
sophisticated users who write specialized
database application that does not fit into the
traditional data-processing framework. Among
these applications are computer aided-design
systems, knowledge-base and expert systems
etc.
Unit-1(Part-2)
Entity – RelationShip Model
➢Design Issues
➢ER Modeling concepts
➢Cardinality constraints
➢Weak-entity types
➢Subclasses and inheritance
➢ Specialization and Generalization
➢Conceptual Database Design With the ER
Model.
E-R Modelling Concepts
• A database can be modeled as:
– a collection of entities,
– relationship among entities.
• An entity is an object that exists and is distinguishable
from other objects.
– Example: specific person, company, event, plant
• Entities have attributes
– Example: people have names and addresses
• An entity set is a set of entities of the same type that
share the same properties.
– Example: set of all persons, companies, trees,
holidays
Entity Sets customer and loan
customer_id customer_ customer_ customer_ loan_ amount
name street city number
Attribute
• An entity is represented by a set of attributes, that is
descriptive properties possessed by all members of an
entity set.
Domain – the set of permitted values for each attribute
• Attribute types:
– Simple and composite attributes.
– Single-valued and multi-valued attributes
– Derived attributes
Attributes

➢Simple Attribute: An attribute which cannot be divided into sub


parts. Ex: Student_id, marks
➢Composite attributes:- the attributes which are divided into sub
parts. Ex: Name, Address
➢Single Valued attribute: An attribute which holds only single
value Ex: Emp_id
➢Multivalued attributes: which can have many values.
Ex.contact_no
➢Derived Attributes: An attribute can be computed from the other
attribute. Ex: Age derived from Date of Birth.
Entity Set
An entity set is a collection or set of all entities of a particular
entity type at any point in time. The type of all the entities
should be the same.
Example :
• The collection of all the students from the student table at a
particular instant of time is an example of an entity set.
• The collection of all the employees from the employee table
at a particular instant of time is an example of an entity set.

E1

E2
E3
E4
Cardinality Constraints
Cardinality defines the number of entities in one entity set,
which can be associated with the number of entities of other
set via relationship set.
Cardinality are of 4 types:
➢ One to one
➢ One to many
➢ Many to one
➢ Many to many
One-to-one : One entity from entity set A can be
associated with at most one entity of entity
set B and vice versa.
For example, if a person and passport are two identities, then
one person can have exactly one passport and only one
passport can be assigned to a person.
One-to-many : One entity from entity set A can
be associated with more than one entities of
entity set B however an entity from entity set
B, can be associated with at most one entity.
For example, one teacher can teach many
students at a time.
Many-to-one − More than one entities from entity set
A can be associated with at most one entity of entity
set B, however an entity from entity set B can be
associated with more than one entity from entity set
A.
For example, let us consider two tables employee
table and a department table. Here many
employees can work for one department.
Many-to-many − One entity from A can be
associated with more than one entity from B
and vice versa.
For example, a many-to-many relationship exists between
customers and products: customers can purchase various
products, and products can be purchased by many
customers.
Entity Types
An entity is referred to as an object or thing that exists in the real world. For
example, customer, car, pen, etc.

Entity Type:
➢ A collection of entities with general characteristics is known as an entity
type.
➢ For example, a database of a corporate company has entity types such as
employees, departments, etc.
➢ In DBMS, every entity type contains a set of attributes that explain the
entity.
➢ The Employee entity type can have attributes such as name, age, address,
phone number, and salary.
➢ The Department entity type can have attributes such as name, number,
and location in the department.

Two Entity Types:

➢ Strong Entity
➢ Weak Entity
Strong Entity Type
Strong Entity Type: It is an entity that has its own existence and
is independent.
The entity relationship diagram represents a strong entity type
with the help of a single rectangle. Below is the ERD of the
strong entity type:
Weak Entity Type: It is an entity that does not have its own
existence and relies on a strong entity for its existence.
The Entity Relationship Diagram represents the weak entity type
using double rectangles. Below is the ERD of the weak entity
type:
➢ The relationship between a strong and a weak entity type is
known as an identifying relationship.
➢ Using a double diamond, the Entity-Relationship Diagram
represents a relationship between the strong and the weak
entity type.
Sub Classes and Inheritance
The Enhanced Entity Relationship Model contains all the features
of the Entity Relationship model.
In addition to all that, it also contains features of
➢ Subclasses,
➢ Super classes
➢ Inheritance.
Subclasses:
A subclass is a class derived from the superclass. It inherits the
properties of the superclass and also contains attributes of its
own.
An example is:
➢ 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 2.
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.
➢ In the above example, Vehicle is the Superclass and its
subclasses are Car, Truck and Motorcycle.
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 for super class, sub class and
inheritance
Generalization and Specialization
Generalization:
➢ It works on the principle of bottom up approach. In
Generalization lower level functions are combined to form
higher level function which is called as entities. This process is
repeated further to make advanced level entities.
➢ In the Generalization process properties are drawn from
particular entities and thus we can create generalized entity.
We can summarize Generalization process as it combines
subclasses to form superclass.
Consider two entities Student and Patient. These two entities will have some
characteristics of their own. For example Student entity will have Roll_No,
Name and Mob_No while patient will have PId, Name and Mob_No
characteristics. Now in this example Name and Mob_No of both Student
and Patient can be combined as a Person to form one higher level entity
and this process is called as Generalization Process.
Specialization
We can say that Specialization is opposite of Generalization. In
Specialization things are broken down into smaller things to
simplify it further.
We can also say that in Specialization a particular entity gets
divided into sub entities and it’s done on the basis of it’s
characteristics. Also in Specialization Inheritance takes place.
Example:
Consider an entity Account. This will have some attributes consider them
Acc_No and Balance. Account entity may have some other attributes like
Current_Acc and Savings_Acc. Now Current_Acc may have Acc_No,
Balance and Transactions while Savings_Acc may have Acc_No, Balance
and Interest_Rate henceforth we can say that specialized entities inherits
characteristics of higher level entity.
Participation Constraints
The participation constraints specifies the
number of instances of an entity can
participate in a relationship set.

Two Types:
➢Total Participation
➢Partial Participation
Total Participation
If every entity in E participate in atleast on
relationship in R is said to be Total
Participation
Denoted by double line

Ex: Expect every loan entity to be related to


atleast one customer through borrower
relationship
Borro
customer Loan
wer
Partial Participation
If only some entities in E participates in
relationship R, said to be partial participation.
Denoted by single line

Ex: An individual can be a bank customer,


whether or not has a loan with bank

borro
Customer Loan
wer
Conceptual Database Design With the
ER Model
For designing conceptual scheme for large enterprises we are
required with 5 steps.
➢ Identify the entities
➢ Find the relationships
➢ Identify the key attributes for each entity
➢ Indentify the other attributes for each entity
➢ Complete ER Diagram
ER Diagram for a Company
➢ One company has so many kinds of employees
➢ Some of the employees are supervisors
➢ The company has so many departments
➢ Some of the employees manage the department
➢ Employees works on a project
➢ Department controls the project
➢ Company maintains the details of the dependencies
of the particular employee
Step-1:
Identify the entities:
➢ Employee- Strong entity
➢ Department- Strong entity
➢ Project- Strong entity
➢ Dependencies- Weak entity
Step-2:
Identify the Relationship
➢ Works for
➢ Manages
➢ Works on
➢ Controls
➢ Depends- Weak relationship
Step-3:
Identify key attribute
➢ Emp_no (primary key)
➢ Dept_no (primary key)
➢ Prjt_no (primary key)
➢ D_no (foreign key)

Step-4:
Identify the other attributes
➢ Emp_name, addr, dob
➢ Dept_name, Dept_loc
➢ P_name, P_date
Complete ER Diagram

You might also like