Question: sql 1) Write a query against the TSQL2012 database to retrieve; from the production.products table, the [supplierId] and the count of products supplied by each

sql

1) Write a query against the TSQL2012 database to retrieve;

from the production.products table, the [supplierId] and the count of products supplied by each supplier that are not discontinued. Only return suppliers that supply 3 or more products. Order the list by the count returned in descending order then by [supplierId] in ascending order.

2)

Create a query that returns the following columns of the order placed by the customer with [Sales].[Customer].[AccountNumber] of AW00029716 on [ SalesOrderHeader].[OrderDate] March 31, 2014.

Sales.SalesOrderHeader.PurchaseOrderNumber, Sales.SalesOrderHeader.SubTotal, Sales.SalesOrderHeader.TaxAmt, Sales.SalesOrderHeader.TotalDue, Person.Address.AddressLine1, Person.Address.AddressLine2, Person.Address.City, Person.Address.PostalCode

3)

From the AdvetureWorks database's production.productCostHistory table;

Calculate the average [standardCost] of all active products with IDs 707 through to (and including) 799. Display this single value result set with 2 decimal places precision.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!