Question 1: For each part, show the Sales Orders that sold that part. Show the Parts that have no sales as well. Display the PartID, Part Name, Sales Order #, the Quantity sold and the price for the order.
Hint: A Left Join returns everything already selected even if it doesn’t match the tables following. An Inner Join only returns those rows that match the condition in both tables. A Right Join is the opposite of a Left Join: It returns rows in every table AFTER the join even if the previous rows are not matched.
Question 2: For each Part, show the PartID, Part Name, Total Quantity sold and the total sales, including Parts with no sales. Order by the quantity sold descending, then by the name of the part.
Hint: Aggregrate columns return results based on “groups” of rows. If you select a non-aggregrate column, your query must GROUP BY those non-aggregrate columns. To convert NULL to 0, use IsNull(column name, 0), for example IsNull(OrderCost, 0).
Question 3: For each Sales Order, show how many days it took to ship the order in order by the longest order, then by Sales Order Number. Display Sales Order Number and the number of days to ship. Include the orders that have not yet shipped.
Hint: Look at the DATEDIFF function to return the difference between two dates. The two dates in this problem are the Order Date and the Shipment Date.
Question 4: Show the orders that are partial shipments meaning that the quantity shipped is less than the quantity ordered. Display the SalesOrderNumber, PartID, Quantity Ordered and the Quantity Shipped in order by SalesOrderNumber, PartID.
Hint: All of this information comes from two tables: SalesOrderPart and ShipmentPart. use the WHERE statement to find the rows where the SalesOrderPart Quantity is greater than (use ‘>’) the ShipmentPart Quantity.
Question 5: Show the total sales by year. Display the year and the total sales. Sort by year.
Hint: Try using the YEAR( some date ) function and the SUM( some column ) aggregate function. Don’t forget your GROUP BY. Note that YEAR( some date ) is a function and not an aggregate meaning that it must be in the GROUP BY expression.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.Read more
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.Read more
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.Read more
Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.Read more
By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.Read more