Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- - You are to develop SQL statements for each task listed. - - You should type your SQL statements under each task. / *
You are to develop SQL statements for each task listed.
You should type your SQL statements under each task.
Submit your sql file named with your last name, first name and assignment # eg SuneelPratimaAssignmentsql
Submit your file to the instructor through the course site.
Class standard: All KEYWORDS such as SELECT, FROM, WHERE, INNER JOIN and so on must be in all capital letters and on separate lines.
Use AdventureWorksDW
Note : When the task does not specify sort order, it is your responsibility to order the information
so that is easy to interpret.
Note : The questions are numbered. abab etc to remind you of the steps in developing and
testing your queriessubqueries The first steps will not require subqueries unless specified. The last step in every sequence
will require a subquery, regardless of whether the result can be created using another method.
a List the average sales amount quota for employees at AdventureWorks. Use AVG. points
b List the average sales amount quota for employees at AdventureWorks for points
c List the name, title, and hire date for AdventureWorks employees
whose sales quota for is higher than the average for all employees for
Be sure to use an appropriate sort. points
Rows
Hint Might want to use WHERE clause Twice!!! Once for inner query and once for outer query.
USE UNCorrelated Subquery
a List the average LIST PRICE of a bike sold by AdventureWorks. point
row
b List all products in the Bikes category that have a list price higher than
the average list price of a bike. Show product alternate key, product name,
and list price in the results set. Order the information so it is easy to understand. points
rows
UnCorrelated subquery
a Find the average yearly income all customers in the customer table. points
b Find all males in the customers table with an income less than or the same as the average
income of all customers. List last name, a comma and space, and first name in one column and yearly income. points
rows
UnCorrelated subquery
a List the product name and list price for the bike named Road Red, points
b List the product name and price for each product that has a price greater than or
equal to that of the Road Red, Be sure you are using the subquery not an actual value. points
rows
USE UnCorrelated Subquery
a List the names of resellers and the product names of products they sold.
Elimate duplicate rows. Use an appropriate sort. points
rows
b List only one time the names of all resellers who sold a cable lock.
Use the IN predicate and a subquery to accomplish the task. Use an appropriate sort. points
rows
USE UnCorrelated Subquery
a Find the unique customers from the Survey Response fact table. points
ROWS
a Find the number of times the CustomerKey appears in the Internet Sales Fact table. points
Use COUNT
List all resellers whose annual sales exceed the average annual sales for resellers whose Business Type is "Specialty Bike Shop". Show Business type, Reseller Name, and annual sales. Use appropriate subqueries. points
Rows
Use Uncorrelated sub query
Subqueries can be nested deep. Try your hand at nesting a subquery within a subquery. points
State the purpose of the query and then try.
Add a comment to help your tutor better understand your question
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started