Question:

Consider the schema:

EMP (eid:integer, ename:string, age:integer, salary:real)
Works (eid:integer, did:integer, pct-time:integer)
Dept (did:integer, dname:string, budget:real, manager_id:integer)

Specify the number of possible foreign keys in the above schema.

Responses

tar_gate's picture

In the works relation, eid and did seems to be foreign keys from EMP and Dept relation. Also in the Dept relation manager_id seems to be the foreign key from EMP (eid). So total possible foreign keys as per me are 3.

kaushalmaurya's picture

I think only eid and did is foreign keys from EMP and Dept relation. so, total no of foreign  keys are 2.

yogesh42's picture

plz explain for manager-id ??

tar_gate's picture

Assuming that for every department there is a manager, and as the manager is also an employee and has his own eid, the manager_id field of Dept can serve as the foreign key for eid of EMP relation.

 

 

Did not found what you are looking for, Ask your doubt or Help by your contribution

Enter your search keyword:

Search form

Wait!

Here is a chance to join biggest community of technical Students,
Tutors with FREE learning resources and so much more.
It takes less then 60 seconds.