Question: For each information request below, formulate a single SQL query to produce the required information. In each case, you should display only the columns requested.

For each information request below, formulate a single SQL query to produce the required information. In each case, you should display only the columns requested. Be sure that your queries do not produce duplicate records unless otherwise directed.


1. List the name and list price of products that were sold on a sale for which the shipping cost was over $60. (use two levels of subqueries in where clauses.)
2. List Employees (first and last names) and their hire dates of employees who were hired before their managers. (whose hire date is earlier than their managers hire date). Use a subquery in the where clause.
3. Count the number of unique values of the set of values of PurchaseDate and EmployeeID from the Purchase table. (Use a subquery in FROM) (name column NumbOfEmpPurch)
4. What is the total amount of purchases made in 2015 made by each employee? Include EmployeeID, First and Last names and total amount. (Use a join with a select subquery in the FROM clause. Remember to name the subquery.) Name the column TotalPurchases. When you create it, use both the round and sum functions, i.e. Round (Sum ( ... ) , 2).

Step by Step Solution

3.48 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sure Lets address each request and formulate the SQL queries 1 List the name and list price of produ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!