You are on page 1of 18

LAB 1_A

Question 1

Create table as shown below


1. How many fields in the table?
4 fields

2. What should be done to ID field to avoid duplication?


Set ID field
Question 2
a. How many fields in the table?
4 fields

b. Can two fields have the same name?


Cannot
LAB 1_B
Primary key: {SaleID}

Composite primary key: {SaleID, SaleDate} , {SaleID, SaleTotal}


Question 2
Define primary key in employee table: {EmpID}
Define foreign key in department table: {DeptName}
Question 3
1. Define super key in student table: {StudID}
2. Define candidate key in student table: {RollNo, Name} {RollName, DeptCode}
3. Define primary key in student table: {StudID}
4. Define alternate key in student table: {RollNo, Email}
5. Define foreign key in department table: {DeptName}
1. Define foreign key department table: {DeptName}

You might also like