1
628views
Advanced databse management system questions

Consider the following relational 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, managerid: integer)

Create the tables along with necessary constraints and insert values appropriately.

Write the following queries in SQL:

  1. Print the name of each employee whose salary exceeds the budget of all of the departments that he or she works in.
  2. Find the enames of managers who manage the departments with the largest budgets.
  3. Create view which will hide the salary, managerid details from emp and dept .
  4. If a manager manages more than one department, he or she controls the sum of all the budgets for those departments. Find the managerids of managers who control more than $5 million

Note:[ Please update an answer before 12:00 A.M. (-_-) ]

Please log in to add an answer.