Consider the following relational schema (the primary keys are
underlined and foreign keys are italic)
ITEM(ItemName, ItemType, ItemColour)
DEPARTMENT(Deptname, DeptFloor, DeptPhone, Manager)
EMPLOYEE(EmpNo, EmpFname, EmpSalary, DeptName, SupervisedBy)
SUPPLIER(SupNo, SupName)
SALE(SaleNo, SaleQty, ItemName, DeptName)
DELIVERY(DeliNo, DeliQty, ItemName, DeptName, SupNo)
Write the SQL statements for the following queries:
C1. Find the names of items sold on first and second
floors.
[1 mark]
C2. For each department, list the department name and average
salary of the employees where the average salary of the employees
is great than $28,000.
[1 mark]
C3. List the name and salary of the managers with no more than
10 employees.
[2 marks]
C4. List the names of the employees who earn more than any
employee in the Deliver department. [2 marks]
C5. For each department that sells items of type E, list the
department name and the number of the employees. [2 marks]
C6. Find the supplier name who supplies the least items.