I really need help with doing these queries. PLease Help>>>> I using the SQL Ser
ID: 662304 • 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>>>
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.
4. Query 1- for AdventureWorks
****note error
Explanation / Answer
1) select min(Rate), EmployeeID from HumanResources.EmployeePayHistory group by EmployeeID
2) select t1.EmployeeID, t1.Rate from HumanResources.EmployeePayHistory t1,HumanResources.EmployeePayHistory t2 where t1.Rate = t2.min(Rate)
3) select min(Rate), max(Rate) from HumanResources.EmployeePayHistory
4) select top 3 Rate, EmployeeID from HumanResources.EmployeePayHistory Order by Rate Asc