Question: Part A In a single script file, please demonstrate the following queries using a single SELECT statement for each. Each answer will use a function
Part A
In a single script file, please demonstrate the following queries using a single SELECT statement for each.
Each answer will use a function or an Aggregate Function. Identify each SELECT statement you have in
the script by the question number in a comment just prior to each answer.
What is the current date and time?
What is the product name and price of the product with the biggest unit price?
What is the category ID and average price for products in each category, for those categories
where the average price is greater than $
Part B
In a single script file, please demonstrate the following queries using a single SELECT statement for each.
Each answer will use a type of JOIN clause. Identify each SELECT statement you have in the script by the
question number in a comment just prior to each answer.
What is the product name and category name for each product in the products table, sorted by
product name?
What is the product name, units in stock, the supplier's contact name and phone number for
each product that has or less units in stock?
What is the customerID, company name, orderID and order date for all customers, even those
that have no orders yet?
What is the customerID and company name for those customers that have no order yet? Hint:
Start with the JOIN you used in the previous question.
What is the first name, last name, city and territory description for each employee. Hint:
Employees and Territories are related manytomany. The EmployeeTerritories table is the
associative table between the two.
For each order detail, what is the product name, quantity sold, orderID, order date and
customer's company name? Make sure this is sorted by order ID then by product name.
Generate a set of all first name and last name combinations from the Employees table. Hint:
You can use the same table on BOTH sides of the JOIN.
Ensure that the top of each script file has header comments, including the assignment number and
description your name and the date of submission.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
