CS-06 Data Base Management System Dec-2003
Q.2(a). Consider the following Relational schema. An employee can work in more than one department:
Emp (Eid, Ename, Salary)
Works (Eid, did)
Dept (did, dname, managerid, floornum)
Write the following in SQL:
(i) Print the names of all employees who work on the 10th floor and earn salary less than Rs. 50,000.
(ii) Print the names of the departments that employee Santa works in.
(iii) Print the names of all managers who manage three or more departments on the same floor.
(iv) Print the names of all employees who work on floor(s) where Jane Donald works.
(v) Give every employee who works in the toys dept. a 10% raise in the salary.
(b) Compare and contrast primary key, candidate key and foreign key by giving a suitable example.