Given the following database representation: WorksOn Database: employees ( empno , ename, bdate, title, salary, deptno) projects
Fantastic news! We've Found the answer you've been seeking!
Question:
Given the following database representation:
WorksOn Database:
- employees (empno, ename, bdate, title, salary, deptno)
- projects (projno, pname, budget, deptno)
- departments (deptno, dname, mgreno)
- workson (empno, projno, responsibility, hours)
Note:
- empnois primary key for employees table
- projnois primary key for projects table
- deptnois primary key for departments table
- bothempno, projnoformthe primary key for workson table
Using the description provided above, answer the following questions:
A.What does the following SQL query do/ return?
SELECT empno, salary
FROM employees, departments
WHERE dname = 'Consulting'
ORDER BY salary DESC
B.In the above (WorksOn) database, write alist of all secondary/foreign keys, thetable namewhere each of these keys belongs, and whichprimary keyeach secondary key references in the other table (state the other table name), in your answerfollow the format in the example below:
- x is the secondary key in table A, it references primary key y in table B
(in your answer write the list of secondary keys as shown above and substitute x, y, A, and B as relevant)
Posted Date: