Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Prepare and execute each of the queries listed using the Adventureworks2012 database in SQL Server. When all of your queries are complete, cut and paste

Prepare and execute each of the queries listed using the "Adventureworks2012" database in SQL Server. When all of your queries are complete, cut and paste the SQL Syntax into a word document to be submitted via SAKAI by the due date. In order to see what the column names are, you need to click on the table and then Columns to see the field names. Make sure to include column headings that make sense in the queries (use the as Field Name after the field selected)

11. Write a query to find all of the employees that work for Research and Development group, that have a start date after 01-01-2005. List their DepartmentID, StartDate, Department Name, and GroupName. Order by StartDate. You will need to use HumanResources.Department, and HumanResources.EmployeeDepartmentHistory tables for this query. You should get 4 records total.

13. Write a query to find out the number of female employees that make over $10 per hour (rate). List their job title, Gender, Marital Status, Hire Date, and Rate. Sort by rate and marital status. Use HumanResources.Employee and HumanResources.EmployeePayHistory. You should get 73 records.

14. Write a query to find out what sales people have a sales quota over 250,000 and are in territory 5. List the Business Entity ID, Territory ID, Sales Quota, Sales YTD, Sales Last Year, Customer ID, and Stored ID. Sort by customer id. Use Sales.SalesPerson and Sales.Customer tables. You should get 176 records.

15. Write a query to find out how many products had a scrapped quantity greater than 20. List the Product ID, Product Name, Product Number, Work Order ID, Order Quantity, Scrapped Quantity, and Scrap Reason ID. Sort by Scrapped Quantity, and then by Product ID. You should get 95 records.

16. Write a query to find out how many people have a Seattle address. List the Address ID, Address Lines (Street and Apt number if available), City, StateProvince ID, Name, and Business Entity ID. Use the Person.Address, Person.AddressType, and Person.BusinessEntityAddress tables. Sort by Address ID. You should get 141 records.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions