Question: Based on the below table, create a function named cust_territory that will accept territoryID as parameter and return number of customers. Then, run the function

Based on the below table, create a function named cust_territory that will accept territoryID as parameter and return number of customers. Then, run the function using a proper parameter.

Object Explorer Connect X Columns CustomerID (PK, int, not null) PersonID (FK, int, null) StoreID (FK, int, 

Object Explorer Connect X Columns CustomerID (PK, int, not null) PersonID (FK, int, null) StoreID (FK, int, null) TerritoryID (FK, int, null) AccountNumber (Computed, varchar(10), not null) Erowguid (uniqueidentifier, not null) ModifiedDate (datetime, not null) Keys + Constraints + Triggers + Indexes + Statistics X + SQLQuery1.sql - D...4H7KGP\samib (57))* X 100% 1 2 3 4 5 6 7 8 9 10 select from sales.customer Results Messages CustomerlD PersonID StorelD TerritoryID AccountNumber rowguid NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 934 1028 642 932 1026 644 930 1024 620 928 1 2 3 4 5 6 7 8 9 10 1 1 4 4 4 4 1 5 5 6 ModifiedDate AW00000001 3F5AE95E-B87D-4AED-95B4-C3797AFCB74F 2014-09-12 11:15:07.263 AW00000002 E552F657-A9AF-4A7D-A645-C429D6E02491 2014-09-12 11:15:07.263 AW00000003 130774B1-DB21-4EF3-98C8-C104BCD6ED6D 2014-09-12 11:15:07.263 AW00000004 FF862851-1DAA-4044-BE7C-3E85583C054D 2014-09-12 11:15:07.263 AW00000005 83905BDC-6F5E-4F71-B162-C98DA069F38A 2014-09-12 11:15:07.263 AW00000006 1A92DF88-BFA2-467D-BD54-FCB9E647FDD7 2014-09-12 11:15:07.263 AW00000007 03E9273E-B193-448E-9823-FE0C44AEED78 2014-09-12 11:15:07.263 AW00000008 801368B1-4323-4BFA-8BEA-5B5B1E4BD4A0 2014-09-12 11:15:07.263 AW00000009 B900BB7F-23C3-481D-80DA-C49A5BD6F772 2014-09-12 11:15:07,263 AW00000010 2014-09-12 11:15:07.263 CDB6698D-2FF1-4FBA-8F22-60AD1 D11DABD

Step by Step Solution

3.38 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To create a function named custterritory that accepts territoryID as a parameter and returns the num... View full answer

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!