You are on page 1of 13

LAB 08

Constraints

Name: ANEESA JABEEN


Enrollment: 01-135211-015
Class: BS IT 4A
LAB TASKS
1. Choose an ERD diagram having multiple relations and relationship with cardinality 1 to 1, 1 to
many and many to many. Paste picture of ERD in question 1.

2. Create Tables and apply the specific constraint using proper constraint name.
3. Alter table and Add primary key constraint on every table.
4. Create Foreign key constraints and implement relationship among tables using references
command.

Student and Enrollment (1 to many):

Lecture and Enrollment(1 to many):


Lecture and Lecturer (1 to many):
Lecturer and Subject (1 to many):

5. Create a separate Table for many to many relationships that includes foreign keys of both table
and composite primary key as well.

Lecture and Suject (many to many):


Student and Lecture (Many to Many):
6. Add constraint using alter table command and then display all constraint applied on every table.
7. Disable constraint of any table and paste screen shot.
8. Enable the constraint using enable command.
9. Drop the constraint and then display the remaining constraint on that specific table.

You might also like