Consider the following relational schema for a used car database (primary keys are italicized):
Note: Create your own instantiations for testing using the appropriate SQL.
CARS (cid,
mid, cyear)
BUYERS (bid,
bname, bcity, age)
MANUFACTURERS (maname,
location)
MODELS (mid,
maname, model)
SALESPEOPLE (sid,
sname, years_employed)
TRANSACTIONS (bid,
cid, sid, amount, month, day, year)
Express the following queries using SQL. The SQL queries should not return duplicates.
Given the following Schema, answer the following querries: employee(fname, minit, lname, ssn, bdate, address, sex, salary, superssn, dno) department(dname, dnumber, mgrssn, mgrstartdate) dept_locations(dnumber, dlocation) project(pname, pnumber, plocation, dnum) works_on(essn, pno, hours) dependent(essn, dependent_name, sex, bdate, relationship) 7. Retrieve the name and address of all employees who work for the 'Research' department. 8. For every project located in 'Stafford', list the project number, the controlling department number, and the department manager's last name, address, and birthdate. 9. Find the names of employees who work on all the projects controlled by department number 5. 10. Make a list of project numbers for projects that involve an employee whose last name is 'Smith', either as a worker or as a manager of the department that controls the project. 11. List the names of all employees with two or more dependents. 12. Retrieve the names of employees who have no dependents. 13. List the names of managers who have at least one dependent.