SlideShare a Scribd company logo
DBMS Basic
Concepts
BY: Ashish Kumar Singh
1
DBMS
2
• Database Management System
• Term Database requires understanding of
data and information
• Data: It can be anything like name, place or
number, etc. Data usually refers to raw data, or
unprocessed data.
• Information: It is organized or classified data so
that it has some meaningful values to the receiver.
– Information is the processed data on which decisions
and actions are based.
Difference between Data
and Information?
3
Data Information
Data is raw facts and figures Information is a processed form of data
For example: 12 is data For example: When 12 is stored in row
column form as shown it is information.
Age 12
Data are atomic level pieces of
information
Information is a collection of data
Data does not help in decision making Information helps in decision making
4
Database
5
• A database is a shared collection of logically
related data designed to meet the information
needs of an organization
• The related information when placed is an
organized form makes a database.
• The organization of data/information is
necessary because unorganized information
has no meaning.
Example
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
Database Management System
12
• DBMS A database management system is the
software system that allows users to define,
create and maintain a database and provides
controlled access to the data.
• A database management system (DBMS) is
basically a collection of programs that enables
users to store, modify, and extract information
from a database as per the requirements.
DBMS ppts  unit1.pptx
Operations on databases
14
• To add new information
• To view or retrieve the stored information
• To modify or edit the existing
• To remove or delete the unwanted
information
• Arranging the information in a desired order
etc.
Components of Database
• Five major components in database system
environment:
– Hardware
– Software
– Data
– Users
– Procedures
15
Components of Database System
16
• Hardware: It is the actual computer system
used for keeping and accessing the database.
DBMS hardware consists of secondary storage
devices like hard disks.
• Software: It is the actual DBMS. Between the
physical database itself and the users of
system is a layer of software, called DBMS.
• Data: Data acts as the bridge between the
machine components and user components.
Components of Database System
17
• Users: There are number of users who can
access or retrieve data on demand using the
applications and the interfaces provided by
DBMS. The users can be:
– Naïve users
– Online users
– Application Programmers
– Sophisticated Users
– Data base Administrator ( DBA)
Components of Database System
18
• Procedures: It refers to the instructions and
rules that govern the design and the use of
the database. The users of the system and the
staff that manage the database requires
documented procedures on how to use or run
the system.
Applications of DBMS
19
• Banking: all transactions
• Airlines: reservations, schedules
• Universities: registration, grades
• Sales: customers, products, purchases
• Online retailers: order tracking,
recommendations
customized
• Manufacturing: production, inventory, orders,
supply chain
• Human resources: employee records, salaries, tax
deductions
Schemas and Instances
20
• Data model:-A set of concepts to describe the
structure of a database, and certain
constraints that the database should obey.
• Schema:- The overall description of the
database is called the Database Schema.
– A schema is defined as an outline or a plan that
describes the records and relationships existing at
the particular level.
• Instance:- Data in the database at a particular
moment in time.
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
Data abstraction
24
• A major purpose of database system is to
provide user with an abstract view of data.
That is, system hides certain details of how
the data are stored and maintained.
Levels of Abstraction(view of data)
25
• Physical level: describes how a record (e.g.,
customer) is stored.
• Logical level: describes what data stored in
database, and the relationships among the data.
DBA, who decides what information to keep in
the database, use the logical level of abstraction.
• View level: describe only part of database.
application programs hide details of data types.
Complexity remain due to variety of information
stored. Views can also hide information (such as
an employee’s salary) for security purposes.
DBMS ppts  unit1.pptx
View of Data
An architecture for a database system
27
Data Independence
28
• Logical Data Independence: The capacity to
change the conceptual schema without having
to change the external schemas and their
application programs.
• Physical Data Independence: The capacity to
change the internal schema without having to
change the conceptual schema.
DBMS ppts  unit1.pptx
Data Independence
30
• The processes of transforming requests and
results between the levels are called mappings.
• When a schema at a lower level is changed, only
the mappings between this schema and higher-
level schemas need to be changed in a DBMS that
fully supports data independence. The higher-
level schemas themselves are unchanged. Hence,
the application programs need not be changed
since they refer to the external schemas.
Data Independence
31
• The processes of transforming requests and
results between the levels are called mappings.
• When a schema at a lower level is changed, only
the mappings between this schema and higher-
level schemas need to be changed in a DBMS that
fully supports data independence. The higher-
level schemas themselves are unchanged. Hence,
the application programs need not be changed
since they refer to the external schemas.
Database Architecture
32
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
Three-tier architecture
40
• External or View level: It is the users’ view of the
database. This level describes that part of the database
that is relevant to each user.
– For example, one user may view dates in the form (day,
month, year), while another may view dates as (year,
month, day).
• Conceptual or logical level: It is the community view of
the database. This level describes what data is stored in
the database and the relationships among the data.
• It represents:
– All entities, their attributes, and their relationships;
– The constraints on the data;
– Security and integrity information.
41
• Internal or storage level: It is the physical
representation of the database on the computer. This
level describes how the data is stored in the database.
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
Database Languages
44
Database languages are used to create and maintain database on
computer.
• Data Definition Language(DDL): It is a language that allows user to
define data and their relationship to other types of data.
– CREATE
– ALTER
– DROP
– TRUNCATE
– RENAME
• Data Manipulation Language(DML):It provides a set of operations
to support the basic data manipulation operations on the data held
in databases. It allows user to insert, update, delete and retrieve
data from the database.
– DELETE
– INSERT
– SELECT
– UPDATE
Database Languages
45
• Data Control Language(DCL): DCL statements control
access to data and the database
– GRANT
– REVOKE
– COMMENT
• Transaction Control Language(TCL): TCL statements
manage the change made by DML statements, and
group DML statements into transactions
– COMMIT
– ROLLBACK
– SAVEPOINT
– SET TRANSACTION
Structure and
Components of DBMS
46
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
Data Models
54
Data Model
55
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
72
73
Why it is imp
74
75
76
77
78
79
80
81
82
83
84
85
86
An ER Diagram consists of the
following components:
1.Entity
2.Attributes
3.Relationships
DBMS ppts  unit1.pptx
Entity
An entity may be an object, place, person, or an event which
stores data in the database. In an entity-relationship diagram,
an entity is represented by a rectangle. Student, course,
manager, employee, patient, etc. are examples of an entity.
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
E-R Model:
Symbols and
notations
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
Constraints
10
• Various types of constraints are:
1. Mapping cardinalities
2. Participation constraints
3. Keys
Mapping Cardinalities
10
cardinality
the number
• Mapping
express
another
entities to which
or cardinality ratios ,
of
be
entity can associated via a
relationship set
• Mapping cardinalities:
– 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.
• One-to-many: One entity from entity set A can be
associated more than one entities of entity set B but
from entity set B one entity can be associated with at
most one entity.
10
• Many-to-one: More than one entities from entity set A
can be associated with at most one entity of entity set B
but one entity from entity set B can be associated with
more than one entity from entity set A.
• Many-to-many: one entity from A can be associated with
more than one entity from B and vice versa.
10
Participation Constraints
10
• The participation of an entity set E in a
relationship set R is said to be total if every
entity in E participates in at least one
relationship in R.
• If only some entities in E participate in
relationships in R, the participation is said to
be partial.
Example
Total participation of Loan entity
10
Keys
10
• The key is defined as the column or attribute
of the database table.
• They are used to establish and identify
relation between tables.
• They also ensure that each record within a
table can be uniquely identified by
a
combination of one or more fields within
table.
Types of Keys
10
1. Superkey: An attribute (or combination of
attributes) that uniquely identifies each row in a
table. It is a super set of candidate key.
2. Candidate key : An attribute (or set of
attributes) that uniquely identifies a row. Let K
be a set of attributes of relation R. Then K is a
candidate key for R if it possess the following
properties:
1. Uniqueness – No legal value of R ever contains two
distinct tuples with the same value of K
2. Irreducibility- No proper subset of K has the
uniqueness property
Types of Keys
3. Primary key : is the candidate key which is
selected as the principal unique identifier. It is a
key that uniquely identify each record in the
table. Cannot contain null entries.
10
Types of Keys
4. Composite Key: Key that consist of two or
more attributes that uniquely identifies an
entity occurrence is called composite key.
Reg_no
11
Crs_id subjects
Types of Keys
11
5. Foreign Key: A foreign key is generally a
primary key from one table that appears as a
field in another where the first table has a
relationship to the second.
In other words, if we had a table A with a
primary key X that linked to a table B where X
was a field in B, then X would be a foreign key in
B.
Example
11
Steps in designing E-R Diagram
11
• There are following steps:
– Identify the entities from the requirement sheets
– Find relationships among those entities
– Identify the key attributes for every entity
– Identify other relevant attributes
– Draw complete E-R diagram with all attributes
including Primary key
– Review your results with your Business users
Example: University Management
System
11
Strong and Weak entity sets
11
• The entity set which does not have sufficient attributes
to form a primary key is called a Weak entity set.
• The entity set which has the primary key is called as
Strong entity set.
• A member of a strong entity set is called dominant
entity and member of a weak entity set is called
subordinate entity.
• Weak entity does not have a primary key but we need
a mean to distinguish among other entities. The
discriminator of a weak entity set is a set of attributes
that allows this distinction to be made. Ex:
payment_number.
Example
11
Example
11
E-R Diagram
11
Roles
• Entity sets of a relationship need not be distinct
• The labels “manager” and “worker” are called roles; they specify
how employee entities interact via the works_for relationship set.
• Roles are indicated in E-R diagrams by labeling the lines that
connect diamonds to rectangles.
• Role labels are optional, and are used to clarify semantics of the
relationship
11
Removing Redundant attributes in
entity set
12
• Once the entities and their corresponding attributes
are chosen, the relationship sets among the various
entities are formed.
• These relationship sets may result in a situation where
attributes in the various entity sets are redundant and
need to be removed .
• Consider the entity sets instructor and department
– Instructor includes the attributes ID, name, dept_name,
and salary with ID as primary key
– Department includes the attributes dept_name, building,
and budget with dept_name as primary key
Removing Redundant attributes in
entity set
12
• Attribute dept_name appears in both entity sets. It is
primary key for entity department, it is redundant in
the entity set instructor and needs to be removed.
• If both entities have one to one relationship then we
can remove it from instructor table as it will get added
up in the relational schema of department.
• But if an instructor has more than one associated
department, the relationship between the entities is
recorded in a separate relation inst_dept
Reduction to relational schema
12
• Both E-R model and relational database model
are abstract, logical representations of real-world
enterprises.
• Because the two models employ similar design
we can convert an E-R design to relational design
• E-R schema can be represented by relation
schema in following ways:
of strong entity sets with Simple
of strong entity sets with Complex
– Representing
Attributes
– Representing
Attributes
– Representation of weak entity sets
– Representation of relationship sets
Representing of strong entity sets with Simple
Attributes
• A strong entity set reduces to a table with the
same attributes as represented in E-R diagram
12
Representing of strong entity sets with
Complex Attributes
• In order to convert an entity having composite
attributes, the composite attributes are
flattened out by creating a separate attribute
for each component attribute.
12
• Multivalued attributes are treated differently
from other attributes. New relation schemas
are created for these attributes.
• Derived attributes are not explicitly
represented in the relational model.
BOOK entity set with author_id as multi-value attribute
12
12
Representation of weak entity sets
• For schemas derived from a weak entity set,
the combination of the primary key of the
strong entity set and the discriminator of the
weak entity set serves as primary key of the
schema.
payment = ( loan_number, payment_number,
payment_date, payment_amount )
12
12
Representation of relationship sets
• There are different strategies used for each
type of relationship.
1. Conversion of many to many relationship to
relational model:
– A many to many relationship set is represented as
a table with columns for the primary keys of the
two participating entity sets, and the descriptive
attributes of the relationship set.
12
13
2. Conversion of one to many relationship to
relational model:
For one to many or many to one relationship,
there is no need to create the separate table for the
relationship. Copy the primary key of entity set on one
side of relationship into the entity set on “many” side
of relationship.
13
Customer and Loan relationship with 1:M type 74
133
3. Conversion of one to one relationship to
relational model:
• In case of 1:1 relationship, there is no need to
create a separate table for relationship and
the primary key of any entity set can be
134
moved to other side depending
requirement. It is preferable to
upon the
copy the
primary key of non-totally participated entity
set towards totally participated entity set.
Design Issues
135
• There are number of different ways to define
set of entities and relationship among them.
We examine basic issues in the design of an E-
R model. These are:
–Use of entity sets vs. attributes
–Use of entity sets vs. relationship sets
–Binary versus n-ary relationship sets
–Placement of relationship attributes
Design Issues: Use of entity sets vs.
attributes
• Treating telephone as an attribute telephone-number implies that
employees have exactly one telephone number each
• Treating telephone as an entity permits employees to have several
telephone numbers associated with them.
• The distinctions to consider an object as attribute or entity depends
on the structure of real-world enterprise being modeled.
136
Design Issues: Use of entity sets vs. relationship sets
• Each loan is represented by a relationship between a customer and
a branch, if every loan is associated with exactly one customer and
is associated with exactly one branch
• If several customers hold a joint loan then, loan should be
considered as an entity
137
The guideline in determining whether to use an entity set or
a relationship set is to designate a relationship set to
describe an action that occurs between entities
138
Design Issues: Binary versus n-ary
relationship sets
• Although it is possible to replace any nonbinary (n-ary, for n >
2) relationship set by a number of distinct binary relationship
sets, a n-ary relationship set shows more clearly that several
entities participate in a single relationship.
139
• There is one advantage of using binary relationship, with this it is
possible to store partial information but in ternary relationship it
is not possible to represent it.
• But there are some relationships that are naturally non-binary.
140
Design Issues: Placement of relationship
attributes
141
• The cardinality ratio of a relationship can affect the
placement of relationship attributes
• Example: Let us take two entities instructor and student
with relationship advisor, if we want to add attribute date (
which specifies when the instructor became advisor)
• If relationship is one to many then the date must be placed
to the entity set on the “many” side of relationship
• For one to one relationship, it could be placed on either
side
• For many to many relationship, the date must be placed as
the relationship attribute
Extended ER features
Generalization
Specialization
Aggregation
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx
DBMS ppts  unit1.pptx

More Related Content

PPTX
01-database-management.pptx
dhanajimirajkar1
 
PPTX
Unit-1 DBMS24.pptxruzruxtidtixift8ffticiycyoc
dagadsai0330
 
PPT
data base
Surya Swaroop
 
PPT
Ch1_Intro-95(1).ppt
RAJULKUMARSUTHAR
 
PPTX
Dbms unit 1
SaiGupta18
 
PPTX
DBMS - chapter 1 DATABASE METHOD OF SYSTEM 1.pptx
Vardhanpatil7
 
PPTX
Introduction to Database System-WEEK2.pptx
melissaguillermo
 
PPTX
Ch 2-introduction to dbms
Rupali Rana
 
01-database-management.pptx
dhanajimirajkar1
 
Unit-1 DBMS24.pptxruzruxtidtixift8ffticiycyoc
dagadsai0330
 
data base
Surya Swaroop
 
Ch1_Intro-95(1).ppt
RAJULKUMARSUTHAR
 
Dbms unit 1
SaiGupta18
 
DBMS - chapter 1 DATABASE METHOD OF SYSTEM 1.pptx
Vardhanpatil7
 
Introduction to Database System-WEEK2.pptx
melissaguillermo
 
Ch 2-introduction to dbms
Rupali Rana
 

Similar to DBMS ppts unit1.pptx (20)

PPTX
Introduction to Database Management Systems (DBMS)
Vijayananda Ratnam Ch
 
PPTX
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra
 
PPT
Ch1 2
Bibin Devadas
 
PPT
Ch1
CAG
 
PPT
Ch1
guest5c197d5
 
PPT
1. Introduction to DBMS
koolkampus
 
PPT
Database system concepts
Kumar
 
PPTX
DATABASE MANAGEMENT SYSTEMS CS 3492.pptx
venigkrish89
 
PPT
Database management system lecture notes
UTSAHSINGH2
 
PDF
Introduction to Database Management System
Hitesh Mohapatra
 
PPTX
unit 1.pptx
NIVETHA37590
 
PPTX
Data concepts
Sachidananda M H
 
PPTX
DBMS
addisonabner
 
PPTX
Presentation on Database management system
Prerana Bhattarai
 
PPTX
DBMS-material for b.tech students to learn
Rajasekhar364622
 
PPTX
unit 1.pptx
GayathriPG3
 
PPTX
DATABASE MANAGEMENT SYSTEMS PPT .pptx
YogeshGarg228050
 
PPTX
Fundamentals of database system - Database System Concepts and Architecture
Mustafa Kamel Mohammadi
 
PPTX
Introduction to database
gagan bhattarai
 
PPT
Advanced Database Management System_Introduction Slide.ppt
BikalAdhikari4
 
Introduction to Database Management Systems (DBMS)
Vijayananda Ratnam Ch
 
Utsav Mahendra : Introduction to Database and managemnet
Utsav Mahendra
 
Ch1
CAG
 
1. Introduction to DBMS
koolkampus
 
Database system concepts
Kumar
 
DATABASE MANAGEMENT SYSTEMS CS 3492.pptx
venigkrish89
 
Database management system lecture notes
UTSAHSINGH2
 
Introduction to Database Management System
Hitesh Mohapatra
 
unit 1.pptx
NIVETHA37590
 
Data concepts
Sachidananda M H
 
Presentation on Database management system
Prerana Bhattarai
 
DBMS-material for b.tech students to learn
Rajasekhar364622
 
unit 1.pptx
GayathriPG3
 
DATABASE MANAGEMENT SYSTEMS PPT .pptx
YogeshGarg228050
 
Fundamentals of database system - Database System Concepts and Architecture
Mustafa Kamel Mohammadi
 
Introduction to database
gagan bhattarai
 
Advanced Database Management System_Introduction Slide.ppt
BikalAdhikari4
 
Ad

Recently uploaded (20)

PPTX
LIGHT-HUMAN EYE AND THE COLOURFUL WORLD.ppt.pptx
atharvawafgaonkar
 
PPTX
Presentation Homologation Kendaraan Roda 3
delapanpaduprima
 
PPTX
托莱多大学文凭办理|办理UT毕业证i20购买学位证书电子版
xxxihn4u
 
PDF
PC1400-1 KOMATSU Hydraulic Mining Shovels Parts Manual
Heavy Equipment Manual
 
PPTX
Steps_Tutorial_1_Workforce Management.pptx
roshansharma586
 
PPTX
Soffit_Panel_India_Presentation.pptx____
interviewquestion6
 
PPTX
RTM_Module1_Summary_tyiuwyPresentation.pptx
DeepakKumar311204
 
PPTX
oA final ppt parmar vishal bca sem 1 .pptx
parmarvishal6790
 
PPTX
AIMS OBJECTIVES ajjsjsjsjejejejejejejejejj
IsaacAntwi15
 
PPTX
1.02 Ramesh Pinjani - Important Track Design Parameters.pptx
abheeplay
 
PPTX
What Makes A Car Brand Reliable? Check Out These Slides To Know More!
jennifermiller8137
 
PDF
Hitachi 130 EXCAVATOR Repair Manual Download
Service Repair Manual
 
PPT
Operational Risk and its importance an d
icuphamid
 
PDF
PC110R-1 Komatsu Hydraulic Excavator Parts Manual SN 2265010170-Up
Heavy Equipment Manual
 
PPTX
July 2025 - Automobile_Industry_Trends_Presentation.pptx
savithrir7
 
PPTX
STRATEGIC HRM.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
khushigulati2325
 
PDF
PC170LC-11 Komatsu Hydraulic Excvator Parts Manual SN 35001-UP (For KAL)
Heavy Equipment Manual
 
PPTX
What is the most common reason for check engine light on Mercedes
Protech Automotive Services
 
PDF
SAA4D95LE-7A KOMATSU ENGINE PARTS MANUAL SN 800001-UP (For PC138US-11PC138USL...
Heavy Equipment Manual
 
PDF
Reliable Solutions for Maserati Battery, Wiring, and Electronics Problems You...
Kruse Lucas Imports
 
LIGHT-HUMAN EYE AND THE COLOURFUL WORLD.ppt.pptx
atharvawafgaonkar
 
Presentation Homologation Kendaraan Roda 3
delapanpaduprima
 
托莱多大学文凭办理|办理UT毕业证i20购买学位证书电子版
xxxihn4u
 
PC1400-1 KOMATSU Hydraulic Mining Shovels Parts Manual
Heavy Equipment Manual
 
Steps_Tutorial_1_Workforce Management.pptx
roshansharma586
 
Soffit_Panel_India_Presentation.pptx____
interviewquestion6
 
RTM_Module1_Summary_tyiuwyPresentation.pptx
DeepakKumar311204
 
oA final ppt parmar vishal bca sem 1 .pptx
parmarvishal6790
 
AIMS OBJECTIVES ajjsjsjsjejejejejejejejejj
IsaacAntwi15
 
1.02 Ramesh Pinjani - Important Track Design Parameters.pptx
abheeplay
 
What Makes A Car Brand Reliable? Check Out These Slides To Know More!
jennifermiller8137
 
Hitachi 130 EXCAVATOR Repair Manual Download
Service Repair Manual
 
Operational Risk and its importance an d
icuphamid
 
PC110R-1 Komatsu Hydraulic Excavator Parts Manual SN 2265010170-Up
Heavy Equipment Manual
 
July 2025 - Automobile_Industry_Trends_Presentation.pptx
savithrir7
 
STRATEGIC HRM.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
khushigulati2325
 
PC170LC-11 Komatsu Hydraulic Excvator Parts Manual SN 35001-UP (For KAL)
Heavy Equipment Manual
 
What is the most common reason for check engine light on Mercedes
Protech Automotive Services
 
SAA4D95LE-7A KOMATSU ENGINE PARTS MANUAL SN 800001-UP (For PC138US-11PC138USL...
Heavy Equipment Manual
 
Reliable Solutions for Maserati Battery, Wiring, and Electronics Problems You...
Kruse Lucas Imports
 
Ad

DBMS ppts unit1.pptx

  • 2. DBMS 2 • Database Management System • Term Database requires understanding of data and information • Data: It can be anything like name, place or number, etc. Data usually refers to raw data, or unprocessed data. • Information: It is organized or classified data so that it has some meaningful values to the receiver. – Information is the processed data on which decisions and actions are based.
  • 4. Data Information Data is raw facts and figures Information is a processed form of data For example: 12 is data For example: When 12 is stored in row column form as shown it is information. Age 12 Data are atomic level pieces of information Information is a collection of data Data does not help in decision making Information helps in decision making 4
  • 5. Database 5 • A database is a shared collection of logically related data designed to meet the information needs of an organization • The related information when placed is an organized form makes a database. • The organization of data/information is necessary because unorganized information has no meaning.
  • 12. Database Management System 12 • DBMS A database management system is the software system that allows users to define, create and maintain a database and provides controlled access to the data. • A database management system (DBMS) is basically a collection of programs that enables users to store, modify, and extract information from a database as per the requirements.
  • 14. Operations on databases 14 • To add new information • To view or retrieve the stored information • To modify or edit the existing • To remove or delete the unwanted information • Arranging the information in a desired order etc.
  • 15. Components of Database • Five major components in database system environment: – Hardware – Software – Data – Users – Procedures 15
  • 16. Components of Database System 16 • Hardware: It is the actual computer system used for keeping and accessing the database. DBMS hardware consists of secondary storage devices like hard disks. • Software: It is the actual DBMS. Between the physical database itself and the users of system is a layer of software, called DBMS. • Data: Data acts as the bridge between the machine components and user components.
  • 17. Components of Database System 17 • Users: There are number of users who can access or retrieve data on demand using the applications and the interfaces provided by DBMS. The users can be: – Naïve users – Online users – Application Programmers – Sophisticated Users – Data base Administrator ( DBA)
  • 18. Components of Database System 18 • Procedures: It refers to the instructions and rules that govern the design and the use of the database. The users of the system and the staff that manage the database requires documented procedures on how to use or run the system.
  • 19. Applications of DBMS 19 • Banking: all transactions • Airlines: reservations, schedules • Universities: registration, grades • Sales: customers, products, purchases • Online retailers: order tracking, recommendations customized • Manufacturing: production, inventory, orders, supply chain • Human resources: employee records, salaries, tax deductions
  • 20. Schemas and Instances 20 • Data model:-A set of concepts to describe the structure of a database, and certain constraints that the database should obey. • Schema:- The overall description of the database is called the Database Schema. – A schema is defined as an outline or a plan that describes the records and relationships existing at the particular level. • Instance:- Data in the database at a particular moment in time.
  • 24. Data abstraction 24 • A major purpose of database system is to provide user with an abstract view of data. That is, system hides certain details of how the data are stored and maintained.
  • 25. Levels of Abstraction(view of data) 25 • Physical level: describes how a record (e.g., customer) is stored. • Logical level: describes what data stored in database, and the relationships among the data. DBA, who decides what information to keep in the database, use the logical level of abstraction. • View level: describe only part of database. application programs hide details of data types. Complexity remain due to variety of information stored. Views can also hide information (such as an employee’s salary) for security purposes.
  • 27. View of Data An architecture for a database system 27
  • 28. Data Independence 28 • Logical Data Independence: The capacity to change the conceptual schema without having to change the external schemas and their application programs. • Physical Data Independence: The capacity to change the internal schema without having to change the conceptual schema.
  • 30. Data Independence 30 • The processes of transforming requests and results between the levels are called mappings. • When a schema at a lower level is changed, only the mappings between this schema and higher- level schemas need to be changed in a DBMS that fully supports data independence. The higher- level schemas themselves are unchanged. Hence, the application programs need not be changed since they refer to the external schemas.
  • 31. Data Independence 31 • The processes of transforming requests and results between the levels are called mappings. • When a schema at a lower level is changed, only the mappings between this schema and higher- level schemas need to be changed in a DBMS that fully supports data independence. The higher- level schemas themselves are unchanged. Hence, the application programs need not be changed since they refer to the external schemas.
  • 41. • External or View level: It is the users’ view of the database. This level describes that part of the database that is relevant to each user. – For example, one user may view dates in the form (day, month, year), while another may view dates as (year, month, day). • Conceptual or logical level: It is the community view of the database. This level describes what data is stored in the database and the relationships among the data. • It represents: – All entities, their attributes, and their relationships; – The constraints on the data; – Security and integrity information. 41 • Internal or storage level: It is the physical representation of the database on the computer. This level describes how the data is stored in the database.
  • 44. Database Languages 44 Database languages are used to create and maintain database on computer. • Data Definition Language(DDL): It is a language that allows user to define data and their relationship to other types of data. – CREATE – ALTER – DROP – TRUNCATE – RENAME • Data Manipulation Language(DML):It provides a set of operations to support the basic data manipulation operations on the data held in databases. It allows user to insert, update, delete and retrieve data from the database. – DELETE – INSERT – SELECT – UPDATE
  • 45. Database Languages 45 • Data Control Language(DCL): DCL statements control access to data and the database – GRANT – REVOKE – COMMENT • Transaction Control Language(TCL): TCL statements manage the change made by DML statements, and group DML statements into transactions – COMMIT – ROLLBACK – SAVEPOINT – SET TRANSACTION
  • 72. 72
  • 74. 74
  • 75. 75
  • 76. 76
  • 77. 77
  • 78. 78
  • 79. 79
  • 80. 80
  • 81. 81
  • 82. 82
  • 83. 83
  • 84. 84
  • 85. 85
  • 86. 86 An ER Diagram consists of the following components: 1.Entity 2.Attributes 3.Relationships
  • 88. Entity An entity may be an object, place, person, or an event which stores data in the database. In an entity-relationship diagram, an entity is represented by a rectangle. Student, course, manager, employee, patient, etc. are examples of an entity.
  • 101. Constraints 10 • Various types of constraints are: 1. Mapping cardinalities 2. Participation constraints 3. Keys
  • 102. Mapping Cardinalities 10 cardinality the number • Mapping express another entities to which or cardinality ratios , of be entity can associated via a relationship set • Mapping cardinalities: – one to one – one to many – many to one – many to many
  • 103. • One-to-one: one entity from entity set A can be associated with at most one entity of entity set B and vice versa. • One-to-many: One entity from entity set A can be associated more than one entities of entity set B but from entity set B one entity can be associated with at most one entity. 10
  • 104. • Many-to-one: More than one entities from entity set A can be associated with at most one entity of entity set B but one entity from entity set B can be associated with more than one entity from entity set A. • Many-to-many: one entity from A can be associated with more than one entity from B and vice versa. 10
  • 105. Participation Constraints 10 • The participation of an entity set E in a relationship set R is said to be total if every entity in E participates in at least one relationship in R. • If only some entities in E participate in relationships in R, the participation is said to be partial.
  • 107. Keys 10 • The key is defined as the column or attribute of the database table. • They are used to establish and identify relation between tables. • They also ensure that each record within a table can be uniquely identified by a combination of one or more fields within table.
  • 108. Types of Keys 10 1. Superkey: An attribute (or combination of attributes) that uniquely identifies each row in a table. It is a super set of candidate key. 2. Candidate key : An attribute (or set of attributes) that uniquely identifies a row. Let K be a set of attributes of relation R. Then K is a candidate key for R if it possess the following properties: 1. Uniqueness – No legal value of R ever contains two distinct tuples with the same value of K 2. Irreducibility- No proper subset of K has the uniqueness property
  • 109. Types of Keys 3. Primary key : is the candidate key which is selected as the principal unique identifier. It is a key that uniquely identify each record in the table. Cannot contain null entries. 10
  • 110. Types of Keys 4. Composite Key: Key that consist of two or more attributes that uniquely identifies an entity occurrence is called composite key. Reg_no 11 Crs_id subjects
  • 111. Types of Keys 11 5. Foreign Key: A foreign key is generally a primary key from one table that appears as a field in another where the first table has a relationship to the second. In other words, if we had a table A with a primary key X that linked to a table B where X was a field in B, then X would be a foreign key in B.
  • 113. Steps in designing E-R Diagram 11 • There are following steps: – Identify the entities from the requirement sheets – Find relationships among those entities – Identify the key attributes for every entity – Identify other relevant attributes – Draw complete E-R diagram with all attributes including Primary key – Review your results with your Business users
  • 115. Strong and Weak entity sets 11 • The entity set which does not have sufficient attributes to form a primary key is called a Weak entity set. • The entity set which has the primary key is called as Strong entity set. • A member of a strong entity set is called dominant entity and member of a weak entity set is called subordinate entity. • Weak entity does not have a primary key but we need a mean to distinguish among other entities. The discriminator of a weak entity set is a set of attributes that allows this distinction to be made. Ex: payment_number.
  • 119. Roles • Entity sets of a relationship need not be distinct • The labels “manager” and “worker” are called roles; they specify how employee entities interact via the works_for relationship set. • Roles are indicated in E-R diagrams by labeling the lines that connect diamonds to rectangles. • Role labels are optional, and are used to clarify semantics of the relationship 11
  • 120. Removing Redundant attributes in entity set 12 • Once the entities and their corresponding attributes are chosen, the relationship sets among the various entities are formed. • These relationship sets may result in a situation where attributes in the various entity sets are redundant and need to be removed . • Consider the entity sets instructor and department – Instructor includes the attributes ID, name, dept_name, and salary with ID as primary key – Department includes the attributes dept_name, building, and budget with dept_name as primary key
  • 121. Removing Redundant attributes in entity set 12 • Attribute dept_name appears in both entity sets. It is primary key for entity department, it is redundant in the entity set instructor and needs to be removed. • If both entities have one to one relationship then we can remove it from instructor table as it will get added up in the relational schema of department. • But if an instructor has more than one associated department, the relationship between the entities is recorded in a separate relation inst_dept
  • 122. Reduction to relational schema 12 • Both E-R model and relational database model are abstract, logical representations of real-world enterprises. • Because the two models employ similar design we can convert an E-R design to relational design • E-R schema can be represented by relation schema in following ways: of strong entity sets with Simple of strong entity sets with Complex – Representing Attributes – Representing Attributes – Representation of weak entity sets – Representation of relationship sets
  • 123. Representing of strong entity sets with Simple Attributes • A strong entity set reduces to a table with the same attributes as represented in E-R diagram 12
  • 124. Representing of strong entity sets with Complex Attributes • In order to convert an entity having composite attributes, the composite attributes are flattened out by creating a separate attribute for each component attribute. 12
  • 125. • Multivalued attributes are treated differently from other attributes. New relation schemas are created for these attributes. • Derived attributes are not explicitly represented in the relational model. BOOK entity set with author_id as multi-value attribute 12
  • 126. 12
  • 127. Representation of weak entity sets • For schemas derived from a weak entity set, the combination of the primary key of the strong entity set and the discriminator of the weak entity set serves as primary key of the schema. payment = ( loan_number, payment_number, payment_date, payment_amount ) 12
  • 128. 12
  • 129. Representation of relationship sets • There are different strategies used for each type of relationship. 1. Conversion of many to many relationship to relational model: – A many to many relationship set is represented as a table with columns for the primary keys of the two participating entity sets, and the descriptive attributes of the relationship set. 12
  • 130. 13
  • 131. 2. Conversion of one to many relationship to relational model: For one to many or many to one relationship, there is no need to create the separate table for the relationship. Copy the primary key of entity set on one side of relationship into the entity set on “many” side of relationship. 13
  • 132. Customer and Loan relationship with 1:M type 74
  • 133. 133
  • 134. 3. Conversion of one to one relationship to relational model: • In case of 1:1 relationship, there is no need to create a separate table for relationship and the primary key of any entity set can be 134 moved to other side depending requirement. It is preferable to upon the copy the primary key of non-totally participated entity set towards totally participated entity set.
  • 135. Design Issues 135 • There are number of different ways to define set of entities and relationship among them. We examine basic issues in the design of an E- R model. These are: –Use of entity sets vs. attributes –Use of entity sets vs. relationship sets –Binary versus n-ary relationship sets –Placement of relationship attributes
  • 136. Design Issues: Use of entity sets vs. attributes • Treating telephone as an attribute telephone-number implies that employees have exactly one telephone number each • Treating telephone as an entity permits employees to have several telephone numbers associated with them. • The distinctions to consider an object as attribute or entity depends on the structure of real-world enterprise being modeled. 136
  • 137. Design Issues: Use of entity sets vs. relationship sets • Each loan is represented by a relationship between a customer and a branch, if every loan is associated with exactly one customer and is associated with exactly one branch • If several customers hold a joint loan then, loan should be considered as an entity 137
  • 138. The guideline in determining whether to use an entity set or a relationship set is to designate a relationship set to describe an action that occurs between entities 138
  • 139. Design Issues: Binary versus n-ary relationship sets • Although it is possible to replace any nonbinary (n-ary, for n > 2) relationship set by a number of distinct binary relationship sets, a n-ary relationship set shows more clearly that several entities participate in a single relationship. 139
  • 140. • There is one advantage of using binary relationship, with this it is possible to store partial information but in ternary relationship it is not possible to represent it. • But there are some relationships that are naturally non-binary. 140
  • 141. Design Issues: Placement of relationship attributes 141 • The cardinality ratio of a relationship can affect the placement of relationship attributes • Example: Let us take two entities instructor and student with relationship advisor, if we want to add attribute date ( which specifies when the instructor became advisor) • If relationship is one to many then the date must be placed to the entity set on the “many” side of relationship • For one to one relationship, it could be placed on either side • For many to many relationship, the date must be placed as the relationship attribute