Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I really need help with doing these queries. PLease Help>>>> I using the SQL Ser

ID: 662312 • Letter: I

Question

I really need help with doing these queries. PLease Help>>>> I using the SQL Server Management Studio 2012 with the sample database AdventureWorks database file found in Microsoft website>>> I just want to make sure I am doing them right in comparison to the posted solutions.....PLease provide help.....THANK YOU SOOO MUCH

Lab Objective

This lab will allow you to use SQL Server Management Studio to create advanced queries in a database. This software allows you to interact with the database directly. This tool allows a Database Administrator to manage and maintain the database.

Required Materials

SQL Server 2008 (express or full version).

AdventureWorks database file or AdventureWorksR2 database file

Advanced SQL Lab - Tutorial (this document)

Lab Steps

1. Click start, navigate to all programs and select Microsoft SQL Server 2008, and then click on SQL Server Management Studio.

2. Attach the AdventureWorks or AdventureWorks R2 database to SQL Server 2008.

3. You will now create the following queries using Microsoft SQL Server 2008. For each query create a screenshot to show your results. Make sure you use the correct version of each query for your database.

7. Query 4- for AdventureWorks

**** only display first 3 from results list

***enter ASC to see top 3 lowest paid employees!

select top 3 Rate, EmployeeID

from HumanResources.EmployeePayHistory

Order by Rate Desc

8. Query 5-for AdventureWorks

****Note Alias. INNER JOIN returns only those rows that have matches in ***both tables.

SELECT Person.Contact.FirstName + ' ' + Person.Contact.LastName AS [Full Name] FROM Person.Contact INNER JOIN HumanResources.Employee ON Person.Contact.ContactID = HumanResources.Employee.ContactID

9. Query 6-for AdventureWorks

***When need data from 3 tables, need 2 sets of join conditions. Need to ***join first two tables and join result to third table.

SELECT HumanResources.Employee.EmployeeID, Person.Contact.FirstName, Person.Contact.LastName, Person.Contact.Phone, HumanResources.EmployeePayHistory.Rate FROM Person.Contact INNER JOIN HumanResources.Employee ON Person.Contact.ContactID = HumanResources.Employee.ContactID INNER JOIN HumanResources.EmployeePayHistory ON HumanResources.Employee.EmployeeID = HumanResources.EmployeePayHistory.EmployeeID WHERE HumanResources.EmployeePayHistory.Rate > 50 ORDER BY HumanResources.EmployeePayHistory.Rate DESC

Explanation / Answer

for query number 4:

SELECT TOP 10 column FROM table,