Unit III Relational Model 1
Unit III Relational Model 1
Part-1
Collection of relations
Row: Tuple
Table: Relation
Structure of relational databases
Basic structure
Reference: Silberschatz−Korth−Sudarshan, Database System Concepts, Fourth Edition and Sixth Edition
Structure of relational databases
Basic structure (contd.)
➢ Account is a subset of
D1 x D2 x … x Dn
t[account-number] = “A-101”
t[branch-number] = “Downtown”
Sorted table
Ordering of
tuples
• Order of tuples is
irrelevant
• Example:Account
relation with
unordered tuples
Unsorted table
Domain
• The special value null is a
member of every domain (value
is unknown or doesn’t exist)
• Null value causes complications
in the definition of many
operations
• Null values must be eliminated
Structure of relational databases
Database schema
Database schema
Logical design of database
Database
Database instance
Values of data in database at a
given instant of time
Structure of relational databases
Database schema (contd.)
Primary key of
Weak entity set strong
Primary key of the relation entity set on which
Determine primary key for weak entity set
relation schema from consists of the union of the
primary key of the strong depends
primary keys of entity and
relationship sets entity set and the
discriminator of the weak Many-to-one:
entity set Primary key of
“many” entity set
One-to-one:
Relationship set
Primary key of
Union of the primary keys of either entity set
the related entity sets
becomes a super key of the Many-to-many:
relation union of the
primary keys
Structure of relational databases
Keys (contd.)
The instructor relation
Foreign key
• Referencing relation, r1 of
foreign key dependency
• Referenced relation, r2 of
foreign key The department relation
• Example:
• dept_name in instructor
is a foreign key from
instructor referencing
department, dept_name
is primary key of
department
Tuple Relational
Non-procedural
Calculus
Domain Relational
Calculus