Question: List the SQL query that will return the following: For each week, list the week number, the number of units sold and the total dollar

List the SQL query that will return the following: For each week, list the week number, the number of units sold and the total dollar sales for that week (number of garments sold * retail)

Based on the following tables:

Style

Styleno (PK) varchar(6) not null,

vendorid (FK) varchar(3),

deptid (FK) varchar(2),

sdesc varchar(20),

cost DECIMAL(5,2),

retail DECIMAL(5,2)

Region

Regioncode (PK) varchar(2) not null,

rdesc varchar(9)

Store

storeid (PK) varchar(2) not null,

storename varchar(15),

state varchar(2),

typecode (FK) varchar(1),

rent integer(4),

pctcredit integer(4),

regioncode (FK) varchar(2),

storesize integer(4));

Salesperson

Salesid (PK) varchar(2) not null,

sname varchar(20)

storeid varchar(2)

commission integer(2)

Typecode

typecode (PK) varchar(1) not null

typedesc varchar(12)

Vendor

vendorid (PK) varchar(3) not null

vname varchar(10)

vaddress varchar(15)

Department

deptid (PK) varchar(2) not null

deptname varchar(12)

Sale

weekno integer(1)

styleno (FK) varchar(6)

saleid (FK) varchar(2)

numsold integer(2)

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!