Lab 3 (IS)
Lab 3 (IS)
Lab 3
Lap contents:
➢ Types of keys:
− Primary Key
− foreign Key
− Composite Key
➢ Relationships Between Tables:
− Types of relationships (One-to-One, One-to-Many, Many-to-Many)
− Creating and managing relationships
Type of Keys
1) Primary Key
▪ Definition: A primary key is a special ID assigned to each item in a
table. It's unique and ensures no duplicates
▪ Examples: fingerprint , national ID , Student ID
2) Foreign Key
▪ Definition: Foreign Key: A foreign key is a column in a table that links
to the primary key in another table. It helps establish relationships
between tables
3) Composite Key
▪ Definition: A composite key is a combination of two or more columns
that together uniquely identify each record in a database table.
Father Son
Father id Son id
Name Name
Phone Father_ID
Students Table:
Instructors Table:
Courses Table:
InstructorCourse Table:
StudentCourse Table: