Unit I DBMS PNR
Unit I DBMS PNR
UNIT I
Introduction to Databases
Prepared By:
Poonam Railkar
S.K.N.C.O.E., Pune
Poonam Railkar DBMS Unit 1
UNIT I
INTRODUCTION
Purpose of Database Systems
Database Languages
Database Design
Data Models
constraints.
Hard to add new constraints or change existing ones
Database Damage
DATA ABSTRACTION
A major purpose of database system is to provide users with an
abstract view of the data.
System hides certain details of how the data are stored and
maintained.
Levels of Abstraction:
Unit 1
View of required
information
Type definition
Storage blocks
15
View level:
Highest level abstraction describes only part of the
entire database.
application programs hide details of data types.
Attributes
Attribute
4 Degree
A Schema / Relation
Poonam Railkar DBMS Unit 1
Network model: graph
data is represented as collections of records, and relationships
are represented by sets.
Compared with the relational model, relationships are
explicitly modeled by the sets, which become pointers in the
implementation.
The records are organized as generalized graph structures with
name>
Unit 1
43
RELATIONSHIP SETS
Unit 1
45
RELATIONSHIP SETS (CONT.)
The function that an entity plays in a
relationship is called that entitys role
roles are implicit and are not usually specified.
However, they are useful when the meaning of a
relationship needs clarification.
48
DEGREE OF A RELATIONSHIP SET
Refers to number of entity sets that participate in a
relationship set.
Relationship sets that involve two entity sets are
binary (or degree two). Generally, most
relationship sets in a database system are binary.
Relationship sets may involve more than two entity
sets.
Relationships between more than two entity sets
are rare. Most relationships are binary.
Example: Suppose employees of a bank may have jobs (responsibilities) at multiple branches, with
different jobs at different branches. Then there is a ternary relationship set between entity sets
employee, job, and branch
Unit 1
One to one One to many
Note: Some elements in A and B may not be mapped to any
elements in the other set
53
MAPPING CARDINALITIES
Many-to-one
An entity in A is associated with at most one entity
in B. An entity in B however can be associated with
any number of entities in A.
Example : Students mentored by TG
Many-to-many
An entity in A is associated with any no. of entities
in B, an entity in B is associated with any no of
entities in A
Example : Students learn course
Unit 1
Many to one Many to many
Note: Some elements in A and B may not be mapped to any
elements in the other set
55
KEYS
There must be a way to uniquely identify the
entities.
A Key allows to identify a set of attributes that
suffice to distinguish entities from each other.
Keys are also helpful to uniquely identify the
relationship set.
E2 R1
D1
E3
R2 D2
E4
D3
E5 R3
D4
E6
R4
E7
Entity D
Entity E
Poonam RailkarRelationship
DBMS Unit 1
64
PARTIAL PARTICIPATION
E1
E2 R1
D1
E3
R2 D2
E4
D3
E5 R3
D4
E6
R4
E7
Entity E Entity D
Poonam Relationship
Railkar DBMS Unit 1
65
SUMMARY OF SYMBOLS USED IN E-R NOTATION
67
E-R DIAGRAMS
68
E-R DIAGRAM WITH COMPOSITE,
MULTIVALUED, AND DERIVED
Unit 1
Composite
Primary Attribute
Key
Multi-
valued
attribute
Derived
Attribute 69
RELATIONSHIP SETS WITH ATTRIBUTES
Unit 1
relationship in the relationship set
E.g. participation of loan in borrower is total
every loan must have a customer associated to it via borrower
Partial participation: some entities may not participate in any relationship in the relationship set
Example: participation of customer in borrower is partial
76
Poonam Railkar DBMS
ALTERNATIVE NOTATION FOR CARDINALITY
LIMITS
Unit 1
Cardinality limits can also express participation constraints
77
Poonam Railkar DBMS
E-R DIAGRAM WITH A TERNARY
Unit 1
RELATIONSHIP
78
CARDINALITY CONSTRAINTS ON TERNARY
RELATIONSHIP
E.g.
an arrow from works_on to job indicates each
employee works on at most one job at any branch.
SID SSN
1234 9999
5678 8888
P-Key3
E-Set 3
SSN Name
Street City
REPRESENTING MULTIVALUE
ATTRIBUTE
For each multivalue attribute in an entity
set/relationship set
Stud_SID Children
1234 Johnson
1234 Mary
SID Name Major GPA
5678 Bart
1234 John CS 2.8
5678 Lisa
5678 Homer EE 3.6
5678 Maggie
REPRESENTING CLASS HIERARCHY
Two general approaches depending on
disjointness and completeness
SID Status
Gender
Major GPA
SJSU people
Dept
SID
Name
member
Primary Key of Advisor
Dept
115
SCHEMA DIAGRAM
Query processor
Transaction management
Basic Steps
1.Parsing and translation
2.Optimization
3.Evaluation
APRIL 2011
Poonam Railkar DBMS Unit 1
APRIL 2012
Poonam Railkar DBMS Unit 1
APRIL 2010 (2003 COURSE)
Poonam Railkar DBMS Unit 1
OCT 2011
OTHER QUESTIONS
1. Differentiate between a DBMS and a file Processing System
2. Explain in brief different levels of data abstraction
24.When designing an E-R diagram for a particular enterprise, you have several
alternatives from which to choose. What criteria should you consider in making the
appropriate choice?