Once data has been loaded into a database, it can be retrieved and sorted in a variety of different ways depending on the business needs. From a sales database, maybe you are interested in knowing who...

1 answer below »

Once data has been loaded into a database, it can be retrieved and sorted in a variety of different ways depending on the business needs. From a sales database, maybe you are interested in knowing who had the highest sales for the previous month or for the year, or maybe you want to target specific customers in one area to offer them a special deal; you can accomplishing this by querying the data stored in the database.


In this Assigmment, you will continue to use the data from the Week 2 Assignment to create a database.



To complete this Assignment:



  1. Query for the following information:

    • List all the customers from Ada, MI.

    • List all the customers in which the sales representative is from another city.

    • List all the orders for customer 124.

    • List all the parts orders by customer 124.

    • For each sales representative, identify the number of customers, total sales of the customers and the number of parts ordered by the customers.



  2. Query one table and use WHERE to filter the results. The SELECT clause should have a column list, not an asterisk (*). State the purpose of the query; show the query and the output.


  3. Get information from at least3tables in one statement, and provide the output using the Join operator. Use ANSI Join syntax. State the purpose of the query; show the query and the output. Add a screen shot of SS Management Studio showing the query and results.


  4. Get information from2tables in one statement, and provide the output using the Left Outer Join operator. State the purpose of the query; show the query and the output. The outer join should be designed to retrieve information from the left table that has no matches in the right table. If that is not possible for your database, explain why.


  5. Create a query using the IN keyword with a sub-query. State the purpose of the query; show the query and the output.


  6. Create a query using an aggregate function (i.e., min, max, avg, sum, count) and the GROUP BY command. State the purpose of the query; show the query and the output.


  7. Create a query using an aggregate function (i.e., min, max, avg, sum, count) and the GROUP BY command using the HAVING clause to filter the aggregate results. State the purpose of the query; show the query and the output.

Answered Same DayFeb 13, 2021

Answer To: Once data has been loaded into a database, it can be retrieved and sorted in a variety of different...

Neha answered on Feb 14 2021
141 Votes
Select * from customer where city = 'Ada' and state = 'MI';
Select CustomerID,customer.LastName, cu
stomer.FirstName, customer.StreetAddress, customer.City, customer.state, customer.ZipCode, customer.SalesRepID from customer
inner join salesrepresentative on salesrepresentative.SalesRepID = customer.SalesRepID
where customer.city = salesrepresentative.City;
Select * from orders where Customer = 124;
select * from orderlines
inner join orders on orderlines.OrderID = orders.OrderID where Customer = 124;
select count(CustomerID)as NumberOfCustomer, customer.SalesRepID As...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here