Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

SQL queries.

IT 330 Lab 6: Advanced SQL

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.
    • 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:
  • Name each item appropriately.
    • For example: LAB6-AdvSQL-yourName.vsd, LAB6-Questions-yourName.docx
  • Save each item in a single folder.
  • This folder should also be named appropriately.
    • For example: LAB5-yourName
  • Compress the folder.
  • Submit the compressed file in Blackboard.

Lab:

Need assignment help for this question?

If you need assistance with writing your essay, we are ready to help you!

OUR PROCESS

Order

Payment

Writing

Delivery

Why Choose Us: Cost-efficiency, Plagiarism free, Money Back Guarantee, On-time Delivery, Total Сonfidentiality, 24/7 Support, 100% originality

1. Write an SQL statement to get the average, maximum, and minimum quantity per order stored in table “Sales.SalesOrderDetail”, column “SalesOrderID”, for order numbers 43660, 43670, and 43672. This query should be written as a single SQL statement.

  1. Fill out the following table:
Order number Average Maximum Minimum
43660      
43670      
43672      
  1. Submit the SQL statement used to accomplish this task.
  2. How many rows were affected?
  3. Provide a screenshot of the result set.

2. When working in a normalized environment, chances are one will have to combine tables and get a result set into a table. To accomplish this task, the clause JOIN is used. Depending on what result is needed, different forms of this clause are used. They are:

  • INNER JOIN
  • OUTER JOIN (both LEFT and RIGHT)
  • FULL JOIN
  • CROSS JOIN

What all types of JOIN have in common is that they, based on a condition, match one record from one table to one or more records in another table. The result will be records that combine the data from both tables.

INNER JOINs are the most used type of JOIN. They return only the data for which matches were found.

SELECT *

FROM Person.Person

INNER JOIN HumanResources.Employee

ON Person.Person.BusinessEntityID =

HumanResources.Employee.BusinessEntityID

Using the example above, write an SQL query that returns all the information for all contacts stored in thePerson.BusinessEntity table and only the jobTitle from the HumanResources.Employee table. Note that multiple rows may be returned.

  1. Submit the SQL statement used to accomplish this task.
    1. How many rows were affected?
    1. Provide a screenshot of the result set.


 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"