Question

Specify the following queries in SQL on the COMPANY database. Show the result of each query....

  1. Specify the following queries in SQL on the COMPANY database. Show the result of each query.
    1. Retrieve the names of all employees in department 5 who work more than 10 hours per week on the ‘ProductX’ project.
    2. List the names of all employees who have a dependent with the same first name as themselves.
    3. Find the names of all employees who are directly supervised by ‘Franklin Wong’.

  1. Specify the following updates using the SQL update commands. Show the state of each relation after the update.

  1. Insert <‘Robert’,‘F’,‘Scott’,‘943775543’,‘1972-06-21’,‘2365 Main St, Bellaire, TX’,M,58000,‘888665555’, 1> into EMPLOYEE.
  2. Insert <‘453453453’,‘John’,‘M’,‘1990-12-12’,‘spouse’> into DEPENDENT.
  3. Delete the WORKS_ON tuples with Essn = ‘333445555’.
  4. Modify the Mgr_ssn and Mgr_start_date of the DEPARTMENT tuple with Dnumber = 5 to ‘123456789’and ‘2007-10-01’, respectively.
  5. Modify the Hours attribute of the WORKS_ON tuple with Essn = ‘999887777’and Pno = 10 to ‘5.0’.

Homework Answers

Answer #1

a)

b)

c)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using the Company database in Oracle, construct SQL queries for the following (note: I will make...
Using the Company database in Oracle, construct SQL queries for the following (note: I will make the files to create and populate the Company database available on Isadore shortly): List the last name and address of managers who have a dependent with the same first name as themselves. Retrieve the names of all employees who are directly supervised by ‘Franklin Wong’. Retrieve the names of employees in the Research department who work more than 20 hours per week on the...
Use the following tables to answer Q5 and Q6. Tourist (tno, Name, phone, age,loc) Vehicle (Vno,...
Use the following tables to answer Q5 and Q6. Tourist (tno, Name, phone, age,loc) Vehicle (Vno, model, mileage, owner_name, owner_ph)) Rented (tno, Vno) 5. (i)Write an SQL query, to create the table vehicle with following constraints: Vno should begin with second letter ‘v’; Models are one among Thar, X3. Mileage should be above 18 and below 25. No two records can have same phone (ii) Write an SQL query to retrieve the name of the owner who does owns X3...
Find the total number of employees and the total number of dependents for every department (the...
Find the total number of employees and the total number of dependents for every department (the number of dependents for a department is the sum of the number of dependents for each employee working for that department). Return the result as department name, total number of employees, and total number of dependents Based on the following table: -- drop tables DROP TABLE EMPLOYEE CASCADE CONSTRAINTS; DROP TABLE DEPARTMENT CASCADE CONSTRAINTS; DROP TABLE DEPT_LOCATIONS CASCADE CONSTRAINTS; DROP TABLE PROJECT CASCADE CONSTRAINTS;...