Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SQL queries: Write an SQL command that will find any customers who have not placed orders. Find the employees who supervise other employees. For these

SQL queries:

  1. Write an SQL command that will find any customers who have not placed orders.
  2. Find the employees who supervise other employees. For these supervisors list their names and state as well as the number of employees they supervise (label this value HeadCount). List only those supervisors who supervise more than two employees.
  3. List the name of each employee, his or her birth date, the name of his or her manager, and the managers birth date. Give appropriate aliases. Report only those employees who are older than their manager;
  4. For every order that has been received, display the order ID, the total dollar amount owed on that order (youll have to calculate this total from attributes in one or more tables; label this result TotalDue), and the amount received in payments on that order (assume that there is only one payment made on each order). A. To make this query a little simpler, you dont have to include those orders for which no payment has yet been received. List the results in decreasing order of the difference between total due and amount paid B. Now modify the above query to also include those orders for which no payment has yet been received. List again the results in decreasing order of the difference between total due and amount paid.image text in transcribedimage text in transcribed
CUSTOMER_T 1 CUSTOMERID 1 CUSTOMERNAME 1 CUSTOMER ADDRESS 1 CUSTOMERCITY - CUSTOMERSTATE - CUSTOMERPOSTAL CODE CUSTOMERS CUSTOMERSHIP ADDRESS_T DOESBUSINESSIN_T EMPLOYEE_T 1 EMPLOYEEID 10 EMPLOYEENAME EMPLOYEEADDRESS - EMPLOYEECITY 1 EMPLOYEESTATE - EMPLOYEEZIP 1 EMPLOYEEBIRTHDATE 1 EMPLOYEEDATEHIRED - EMPLOYEESUPERVISOR EMPLOYEESKILLS_T ORDER_T 0 ORDERID - CUSTOMERID - ORDERDATE FULFILLMENTDATE 1 SALESPERSONID 1 SHIPADRSID ORDERLINE_T ORDERLINEID 0 ORDERID 1 PRODUCTID - ORDEREDQUANTITY CUSTOMER_T 1 CUSTOMERID 1 CUSTOMERNAME 1 CUSTOMER ADDRESS 1 CUSTOMERCITY - CUSTOMERSTATE - CUSTOMERPOSTAL CODE CUSTOMERS CUSTOMERSHIP ADDRESS_T DOESBUSINESSIN_T EMPLOYEE_T 1 EMPLOYEEID 10 EMPLOYEENAME EMPLOYEEADDRESS - EMPLOYEECITY 1 EMPLOYEESTATE - EMPLOYEEZIP 1 EMPLOYEEBIRTHDATE 1 EMPLOYEEDATEHIRED - EMPLOYEESUPERVISOR EMPLOYEESKILLS_T ORDER_T 0 ORDERID - CUSTOMERID - ORDERDATE FULFILLMENTDATE 1 SALESPERSONID 1 SHIPADRSID ORDERLINE_T ORDERLINEID 0 ORDERID 1 PRODUCTID - ORDEREDQUANTITY

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Problem: Evaluate the integral: I = 1- 1 dx 9

Answered: 1 week ago

Question

Describe the Indian constitution and political system.

Answered: 1 week ago

Question

Explain in detail the developing and developed economy of India

Answered: 1 week ago

Question

Problem: Evaluate the integral: I = X 52+7 - 1)(x+2) dx

Answered: 1 week ago

Question

What is gravity?

Answered: 1 week ago

Question

LO1 Understand risk management and identify its components.

Answered: 1 week ago