Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ID: C005 For the following questions, use the relational schema defined as follo

ID: 3729314 • Letter: I

Question

ID: C005 For the following questions, use the relational schema defined as follow (6 points each, 60 points in total). Employee Department (empNo·Name, I Name, address, DOB, sex, position, depNo) (depl deptName, mgrEmpNo) (projNo, proj Name, deptNo) (empNo, projNo, date Worked, hoursWorked) WorksOn Where Employee Department contains employee details and emp No is the primary key. contains department details and deptNo is the primary key. mgrEmpNo id employee who is the manager of the department. There is only one m department contains details of the projeets in each department and the primary key is projNo (no two departments can run the same project). contains details of the hours worked by employees on each project, and empNo projNo dateWorked form the primary key anager f or each Project WorksOn 18. Insert one new row to the Employee table. 19. Promote the employee John White to Manager 20. List all employees in descending order of their age

Explanation / Answer

ANS18. insert into Employee values(10,'Harry','Potter','London','1999-12-17','Male','Manager',2);

ANS19. update Employee set position = 'Manager' where fName ='John' and lName = 'White';

ANS20. select * from Employee order by DATEDIFF(YY, DOB, GETDATE()) DESC;