Lecture 3
Lecture 3
Saba Ghani
FAST-NU
Chiniot-Faisalabad campus
Week 3
► Key of a Relation:
► Each row has a value of a data item (or set of items) that uniquely
identifies that row in the table
►Called the key
► In the STUDENT table, SSN is the key
Relational Database Schema
► Relational Database Schema:
► A set S of relation schemas that belong to the same database.
► S is the name of the whole database schema
► S = {R1, R2, ..., Rn}
► R1, R2, …, Rn are the names of the individual relation schemas within the database S
► Following slide shows a COMPANY database schema with 6 relation schemas
Relational Database Schema
Schema of Relational database
Candidate Keys
Although, candidate keys are STU_ID, CIT_ID. Organization ITSELF issues its own
identifier PK. PK is a property of an organization. Driving license# is a property of
Ministry of Motors/ transportation, it must not be used PK in university or other
organizations. It is a candidate key for other organization for search purposes.
Note: It is not recommended to create PKs for columns like Quantity, Salary, Price
and column that has datatype DATE
Surrogate Key