0% found this document useful (0 votes)
128 views3 pages

P3 - Exercise

The document outlines 10 SQL queries: 1. Display unit price and order quantity where unit prices are identical 2. Display order number, total due, order day, and weekday 3. Display customer ID, name (first 15 letters), and salesperson ID for all stores
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
128 views3 pages

P3 - Exercise

The document outlines 10 SQL queries: 1. Display unit price and order quantity where unit prices are identical 2. Display order number, total due, order day, and weekday 3. Display customer ID, name (first 15 letters), and salesperson ID for all stores
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

Display SalesOrderID, OrderQty, And UnitPrice from the SalesOrderDetail table where a similar unit
price nedds to be marked with an identical value

2. Display all orders in the following format


Order Number Total Due Day of Order Week Day

3. Display the customer ID, name, and sales person ID for all the stores. According to the requirement,
only first 15 letters of the customer name should be displayed.
4. Display the total unit price and the total amount collected after selling the products,774 and 777. In
addition, calculate the total amount collected from these two products.

5. A report containing the sales order ID and the average value of the total amount, which is greater
than $5.000 is required in the following format.
Sales Order ID Average Value

6. The following SQL Query containing the COMPUTE BY clause generates errors. What are possible
causes of such errors?

SELECT ProductID, LineTotal AS ‘Total’ FROM Sales.SalesOrderDetail COMPUTE sum(LineTotal) BY


ProductID
7. Display the Order ID of the top five orders based on the total amount due in the year 2001.
Hint : you can extract the year part form a date using the Datepart function.

8. Display the EmployeeID and the HireDate of the employees from the Employee table. The month and
the year need to be displayed.

9. Display the total value of all the orders put together

10. Display the maximum,minimum and the average rate of sales orders

You might also like