Assignment:
Objectives:
1. Explore more advanced SQL queries.
2. Answer the questions, copy the SQL code, create screenshots, and submit the results.
Submission requirements:
• For all text and image submissions, use MS Word, which is available to you within the Virtual Desktop Infrastructure (VDI).
• For all SQL code submissions, use MS Word, which is available to you within VDI.
• For all diagram submissions, use MS Visio, which is available to you within VDI.
o Note: If you need assistance on how to get started with this tool, go to the references section at the end of this document.
• If the submission is more than one file:
1. Name each item appropriately.
a. For example: LAB5-SQL-yourName.vsd, LAB5-Questions-yourName.docx
2. Save each item in a single folder.
3. This folder should also be named appropriately.
a. For example: LAB5-yourName
4. Compress the folder.
5. Submit the compressed file in Blackboard.
Lab:
1.Using the AdventureWorks database, query "Sales.SalesOrderDetail" table to find out the total number of parts associated with each of the following SalesOrderIDs: 43660, 43670, and 43672. This task should be completed in a single query.Submit the SQL statement used to accomplish this task.
o How many rows were affected?
o Provide a screenshot of the result set.
2. Query "Sales.Store" table to obtain the list of "Name" and "SalesPersonID" where the store name starts with the letters "g" through "j" and the SalesPersonID is greater than 283. Make sure that the list is sorted by "SalesPersonID" and then by "Name" fields in a descending order. Be sure the query returns all the required rows.
a. Submit the SQL statement used to accomplish this task.
b. How many rows were affected?
c. Provide a screenshot of the result set.
Hint: Combine WHERE clause conditions and also have an ORDER BY clause in place.