Make relation b w two tables with foreign key with example EMP-01318
This subjective question is related to the book/course vu eng201 Business and Technical English Writing. It can also be found in vu eng201 Mid Term Solved Past Paper No. 5.
Question 1: Make relation b/w two tables with foreign key with example.
EMP (empId, empName, qual, depId)
DEPT (depId, depName, numEmp)
EMP (empId, empName, qual, depId)
DEPT (depId, depName, numEmp)
Answer:
In this example there are two relations; EMP is having record of employees, whereas DEPT is having record of different departments of an organization. Now in EMP the primary key is empId, whereas in DEPT the primary key is depId. The depId which is primary key of DEPT is also present in EMP so this is a foreign key. (Page 133)