Question: Write SQL Queries to answer the following questions (Use Sales.SalesOrderHeader Table ): List CustomerIDs for the SalesPerson ID = 285 How many distinct TerritoryIDs are

Write SQL Queries to answer the following questions (Use Sales.SalesOrderHeader Table ):
- List CustomerIDs for the SalesPerson ID = 285
- How many distinct TerritoryIDs are there?
- Select top 10 biggest orders (hint: use TotalDue field)
- For the top 10 biggest orders, what is the percentage of Freight plus Tax Amount vs. Total amount of the order (Hint: FORMAT(, 'P0') use the following format option)
- How many orders were placed online (Hint: use field OnlineOrderFlag = 1)
> e 5 File Edit View Help SOLOey_3 - SOLEXPRESS Adventure Vors2014 Integrated) - Azure Data Studio A CONNECTIONS III Notebook Week-fynb. Sery 1 - ASIF...grated) E Sery 2-15IF..Grated Sale Sale OrderHeader 1 ESQ Query Surgitech X Notebook Week 611.pynh SERVERS Daun Cancer SD connect 3 Charpe Comection Machverture Worker2014.bplan Elie SOLCHD - Escort as Notebook Production station 11 !!! Production beton Creditrandiarande 10 Currency RaceID III Production Product Sunt > Product Product Category [) Production Productcathit... [rrett 23 lulu Production Products 24 Coment) > It Production Product Document Irand Ant) 26 [Montreal # Proton Productivity PHOM Adventur2014). Salus. Surduradur] Production Practice > Production Product Model > PE Production Product Modell.. # Production Product Macker.. > - Produto Praha > > Production ProductProduct Results Messages > Production Product Review Siren- Sales derin Reviciamber Onderste Duente Shipbute Statue OnlinderPl Sale Onde-limber Purchaserber Berounter Customer Salesperson in Teritert si Toide 1 > Production ProductSubcate... 1 1 > Production Serapisson 2011-05-31 01:00.0 2011-06-12 8:22:a.ca 2011-2-7 22:20:00.0 P952214527 12-4829-000676 2025 270 > 2 4 2012-05-18:00.0 2011-06-12 03:30:48.000 5043160 2011-20-U/ 20:18:20.000 DIE Production Transaction History 12 38 N 011/ 2016/2 279 5 5 > Production Taliontisu... 2 2011-05 31 20:00-20.00 2811 86 12 08:32:08.208 2011 06 07 22:08:20.000 5 5043562 P028473110620 18 4020 000642 29734 6 517 Production. Liture 8 2011-05-31 08 110.00 2011-06-12 00:00:00.090 2011-06-07 108180.000 5 5043562 P0.5460174044 10-4020-000227 22994 6 482 > 98 Production WorkOrder 43603 2011-05-31 08:10:08.00 2011-06-12 00:00:00.00 2011-04-87 18:00:00.000 5 e 504303 PODO156170 10-1920.00051 20563 276 1073 > II Production WorkOrderob.. 1 2011-05-31 01:28:20.000 2011-06-12 8:22:a.ca 2011-2-7 22:00:00.0 5014 P10817131955 18-4829-00907 1 1 > Purchasing Producten 45665 2011-05-1 ou. 21-06-12 08:20:08.18 2011-00-U/ 2:08:20.000 5 5045 8:191572 1840146 25 283 1 84 > Durrheng PurchasOnder 8 2010-65 31 08:08:20.08 2811 86 12 00:20:28.08 2011-06-07 20:28:80.000 5 5043565 2016088173883 19208511 38252 276 4 4 > Purchasing Purchaserderi 943657 2011-05-31 08:00:00.00 2011-06-12 00100189.00 2011-06-07 108180.000 5 5043367 201420132599 10-1920-090646 20974 277 3 Purchasing Shi Mood 10 430 2011-05-31 00:00:00.000 2011-06-12 09:08:80.690 2011-0.7 00:00.0095 e 5040563 P016732150295 10-1929-209514 2014 6 529 Purchasing Vurder 11 4 1 211-2-31 21:28:28.8% 2011-06-12 8:22:a.ca 2011-2-7 22:00:00.0 5014 P01412916096 18-22-000578 1 > Sales Country Bagianumery 2011-05-10 231-2::888 2011-06-08:28:80.000 5 30435/8 1.4184116510 184222-40604 205 225 3 810 > Isles. Creditcard 13 43671 2010-65 31 08:08:20.08 2811 86 12 00:20:28.08 2011-06-07 20:28:80.000 5 5043672 0.37129378 192000 29950 1 855 > Sos.Currency 14 43672 2011-05-31 08 110.00 2811-06-12 00:00:00.000 2011-06-07 108180.000 5 5043572 P013962153537 10-1929-0001192067 6 # Sales Currency 154967 2011--::. 2011-06-12 19:08:80.690 2011-06-87 19:38:09.909 5 e 5040573 2013775141202 10-1929-200610 2000 275 2 > Sales Customer 16 41634 1 2011-05-31 01:28:20.000 :. 2011-11-12 00:20:00 2011-2-7 22:20:00.0 501487 20171214156 1-4020-00 200 !!! Sales PersonCred card 1 43/5 2011-05-1 ou. 2011-06-12 08:20:18.00 2011-00-U/ 20:28:00.0035 90435/5 0241216464 18.00 3 Sales Sales Order Dail 18 43676 2011 05 31 00:02:00.0 2811 06 12 00:00:00.000 2011 06-27 20:08:20.000 5 5043575 Sale Salesteder 0.186.16505 29811 18-4920-c017 275 755 > 19 5 2011-05-31 00:00:00.000 2811-86-12 120100.000 2011-06-87 0108180.000 5 5043577 P011849174785 10-4920-90679 29024 278 6 > 556 Sales Sales de endere 20 2011-05-31 10:00.00 2011-05-12 19:29:00.0 2011-01-07 01.09 5 504971 201711016 10-6929-29992 2009 231 > 1021 DIE Sales Salesforcon 2141679 2011-05-31 08:20.000 2011.12 ::. 2011-07-09 SI57 P2714270 # Sales Sant Hil. 10-4222- 27 27 > Sales Salon panus OUTPUT !!! Sales Sales TERMINALES Filter Restart Azure Owls Stuviu lo apply the latest update RSS No problems he heen detected in the wake ofar. > AZURE Update Now Law Rene Nates > SOL SERVER DIG DATA CLUSTER 040 LA 1, Col Spaces: 4 UTF-8 CALF SOL MSSCL 1,000 rows 00.00.00 SOLEXPRESS : AdrentureWorts2014 0 1 > 45678 ESQ Query Surgitech X Notebook Week 611.pynh 11 10 SOLOey_3 - SOLEXPRESS Adventure Vors2014 Integrated) - Azure Data Studio III Notebook Week-fynb. Sery 1 - ASIF...grated) E Sery 2-15IF..Grated Sale Sale Order Header 1 Daun Cancer SD connect 3 Charpe Comection Machverture Worker2014.bplan Elie SOLCHD - Escort as Notebook Creditrandiarande Currency RaceID Sunt [) [rrett [le Coment) Irand Ant) [Monte PHCM [Adventurwira 2014) - [Sales). [Surder Header 23 24 > e Results Messages Comert romguta Postedate MLL MAI > MILL MULL MULL MLL File Edit View Help A CONNECTIONS SERVERS Production station !!! Production beton III Production Product > Product Productory Production Productcathit... Production Products > It Production Product Document # Proton Productivity Production Practice > Production Product Model > PE Production Product Modell.. # Production Product Macker.. - Produto Praha > > Production ProductProduct > fit Production Product Review > Production ProductSubcate... > > Production Scrap Resson > DIE Production Transaction History Hii Production. Thislu. Production. Liture > 19 Production WorkOrder > Bill Production Work Order.. > Purchasing Produsenciar > Purchasing PurcharOrder... > Purchasing Purchase Orderit Purchasing Shi Metod Purchasing Vurder > Slechagi ameny > Sales. Cred card > Sales Currency # Sales Currency > Sales. Customer !!! Sales PersonCred card Salus Sarder Detail > Sale Salesteder > Sales Salenderenderale > DIE Sales Salesforcon Sale SaleHl. Sales Salon !!! Sales Sales RSS > AZURE > SOL SERVER DIG DATA CLUSTERS 6040 15 MA MILL Person ID Territory ID 0111 Toldressio ShipToldress ShpethodID Credit Card CredstCardloprovlCode Currency Rated SubTotal The Pretch Totolbue 955 5 16201 1050417190 B2 NULL 20565.62961971.5149 616.014 23153.2359 5 071 931 5 1157197011 1794.29 134.M 10.0276 1497.120 B 517 5 1546 8924 4 3153.00 989.353 sos.212 6 S 10455 1852055393 4 25832.5289 22251646 32424.04 867.2389 4 1073 1073 5 4322 453031122691 NULL 419.4599 48.2681 12.5833 4723182 1 676 5 955551148 NULL 20432.600 2904.42 234.9921 732.120 27510,60 1 THO 5 1950 VITARA 14757.7715 1375.427 429.9071 16150,00 4 4 1024 1014 5 1354 12212 5. 5. 450.34 152.9921 M. S 10378 55650V153503 MULL 6127.8820 586.1203 183.1626 6876.3649 6 529 529 5 1566 85817113845 2 35944.1542 3461.7654 111.9317 49497.7233 1 1 693 895 5 1553 25677111 74.MS 70.5175 22.6367 187.2585 NIR 5 int 1875V VIGO 6173.012 11.120 517.5 1 295 295 5 150225 2009Videa 8126.7870 782.813 9159.54 6 264 5 3953 95015120582 4 6124.18.20 587.6023 183.6252 6895.4100 2 821 821 5 1417 35931117271 MULL 3746.2015 357.9614 311.8629 4216.6258 250 458 5 19280 261149986 c 2624.3929 251.9187 76.7315 2955.6542 5 5 11 126121161402 NA 5716.512446.1759 170. RAKTAM.AM HAMAM MULL 79065321-39c-4115-5cba-Bred. 2011-06-07 08:00:00.000 79-478-1-41-9672-1956 2011--A7 12:00:00.000 131-14-411-10 2011-20-U ::. 4.ctca 3a 4742 1828 156_ 2813 667 80:08:80.000 9ble748-622-4303-911-3549 2011-06-07 22:08:20.000 228958-3c22-42-9241-09 2011-05-07 08:00:00.000 502291-19-4947-670-761 2011:19.29 2013.- N. 86052370 4320 421 Sec 6712 2811 U 100.000 281cc355-538-494-5642-2510 2011-06-07 00:00:00.000 Fabre5c2-034-lebe-3573-6739 2011-05-07 08:00:00.000 57157-7-79-4-195-615 2011-2-7 19:23:19.00 custoid-14/ 2013 - 20.00 19420202 815 4932 2264 727 2811 U 18.00 c5cd3ae9-41f5-4671-a3f1-d550 2011-06-07 00:08: 80.000 ceba 12-785-le-3646-506 2011-06-07 08:00:00.000 972 fire-thi-4401-87-7641- 2011--12:20:19.29 MULL ML MA MILL MULL MULL > MALL MA! Filter lets node_modules X PROBLEMS OUT TERMINAL LASES No problem be detected in the workspace > Restor Aure Date Stucio lo apply the latest update Update Now La Rimase Notes LA 1, Cell Spaces: 4 UTF-8 CALF SOL MSSCL 1.000 rows 00.00.00 SOLEXPRESS : AdrentureWorks2014 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
