Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the following tables, Create a view that has for each Repno the number of stores in his territory (use table T). Then, using this

Using the following tables, Create a view that has for each Repno the number of stores in his territory (use table T). Then, using this view write a select statement that finds the Repno of the sales rep who has the most stores in his territory compared to the other sales reps.

Just need the code, using SQL/oracleimage text in transcribed

TABLES S SUPPLIER ST- STORE STORENO store number SUPNO supplier number name of store name of supplier CITY city where store is located CITY city of supplier PROVINCE province of supplier STATE state where store is MGR NAME name of manager COUNTRY ountry of supplier COUNTRY country where store is LANG language of the supplier CURRENCY currency used in that country I-ITEM START DATE when we began to use supplier VOLDOLLAR current year sales in dollar ITEMNO item number name of item American or "E oreign COLOR. color of item WEIGHT ght of item PRICE current price ofitems DESC description of item C SOURCE SUPNO supplier number ITEMNO tem number COST em cost R-SALES REP STARTDATE -date sup started to sell item REPNO sales rep number CH HISTORICAL SOURCE NAME name of sales rep SUPNO supplier number DOB date of birth ITEMNO tem number SSNO social security number STARTDATE -date rep started working STARTDATE -date sup started to sell item ENDDATE date sup stopped selling item SALARY salary of rep COST CITY city of rep em cost STATE state of rep COUNTRY country of rep T-TERRITORY WTAREIIOUSE. REPNO rep number WHNO warehouse number STORENO store number city of warehouse STARTDATE date started STATE state of warehouse MGRNAME -manager name INVENTORY STARTDATE -date warehouse opened WHNO warehouse number ITEMNO name of item TR SALES TRANSACTION QTY gty of items in this warehouse SALENO sales number ASOFDATE. dale iuveulury last uuuuled SALEDATE date sale STORENO number of store SALES DET REPNO number of rep SALENO sales transaction number TOTALAMT total amount of sales transaction ITEMNO em number QTY gty of item so PRICE price per unit item at time of sale EQUIVALENT DOMAINS following columns all share the same domains: COLUAIN ISTORE NO STORE NO STORE NO The following columns all share the same domains The following cont mns al share the same domains COLUMN ITEMNO TEMNOI ITEMNO ITEMNO ITEMNO The following columns all share the same domains: The following columns all share the same domains: COLUMN WHINO

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

Students also viewed these Databases questions