USE THE AdventureWorks2012 Database to answer the
question
5. (a) Write a script that declares an integer variable called @SalesCount. Set the value of the variable to the total count of sales in the Sales. SalesOrderHeader table. Use the variable in a SELECT statement that shows the difference between the @SalesCount and the count of sales by customer. (15 points) CustCountDiff CustomerID 1 31462 11000 2 31462 11001 3 31462 11002 4 31462 11003 5 31462 11004 6 31462 11005 7 31462 11006 8 31462 11007 9 31462 11008 10 31462 11009 11 31462 11010 12 31462 11011 13 31463 11012 14 31463 11013 15 31463 11014 16 31464 11015 17 31464 11016 10 21162 11017 (b) Write a batch that declares an integer variable called @Count to save the count of all the Sales.SalesOrderDetail records. Add an IF block that prints "Over 100,000" if the value exceeds 100,000. Otherwise, print "100,000 or less." (5 points)
Over 100,000
USE THE AdventureWorks2012 Database to answer the question
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am