Professional Documents
Culture Documents
CSC271 Database Systems: Relational Model
CSC271 Database Systems: Relational Model
Relational Model
city
Relation as a Set
Say r = { (Junaid, Main, Haripur),
North, Rawalpindi),
Name
Junaid
Sarmad
Kutab
Junaid
Street
Main
North
North
Park
City
Haripur
Rawalpindi
Rawalpindi
Peshawar
Rows as
tuples
Basic Structure
Given sets of domains D1, D2, . Dn
E.g.
A relation r is a subset of
D1 x D2 x x Dn
Thus, a relation is a set of tuples (a1, a2, , an)
where each ai Di
Degree (or arity) of the relation is number of
atomic
6
Relation Schema
A1, A2, , An are attributes
S = (A1, A2, , An ) is a relation schema
Example:
customer (CustomerSchema)
Database
A database consists of multiple relations
Information about an enterprise is broken up
Customer
Depositor
Example Database
Accounts
Customers
Depositors
9
Summary
Topics covered
Relation,
schema
Tuples
and Attributes
10