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...
Write the following SQL queries based on hbsoe database from Mode: Select all the employee information...
Write the following SQL queries based on hbsoe database from Mode: Select all the employee information and list them for first 100 only. Select all the order information from country Germany. How many distinct orders are made from each country? List the names of employees who made orders from country Germany. List the names of companies which supplies chai or tofu
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;...