Question: Based off the below table write a query to get the quantities of the sold products on Wednesday in the category Footwear provided by vendor

Based off the below table write a query to get the quantities of the sold products on Wednesday in the category Footwear provided by vendor Pacific Gear within the Tristate region between the 1st and the 2nd quarter of 2016

CREATE TABLE CALENDAR

(

CalendarKey INT PRIMARY KEY AUTO_INCREMENT,

FullDate DATE,

DayOfWeek VARCHAR(10),

DayOfMonth INT

);

-- PRODUCT Dimension table

CREATE TABLE PRODUCT

(

ProductKey INT PRIMARY KEY AUTO_INCREMENT,

ProductID INT,

ProductName VARCHAR(255),

ProductPrice DECIMAL(10, 2),

ProductVendorName VARCHAR(255),

ProductCategoryName VARCHAR(255)

);

CREATE TABLE STORE

(

StoreKey INT PRIMARY KEY AUTO_INCREMENT,

StoreID INT,

StoreZip VARCHAR(10),

StoreRegionName VARCHAR(255),

DollarsSold DECIMAL(10, 2)

);

CREATE TABLE CUSTOMER

(

CustomerKey INT PRIMARY KEY AUTO_INCREMENT,

CustomerID INT,

CustomerName VARCHAR(255),

CustomerZip VARCHAR(10),

UnitsSold INT

);

CREATE TABLE SALES

(

SaleID INT PRIMARY KEY AUTO_INCREMENT,

Month INT,

Quarter INT,

Year INT,

CalendarKey INT,

StoreKey INT,

ProductKey INT,

CustomerKey INT,

FOREIGN KEY (CalendarKey) REFERENCES CALENDAR(CalendarKey),

FOREIGN KEY (StoreKey) REFERENCES STORE(StoreKey),

FOREIGN KEY (ProductKey) REFERENCES PRODUCT(ProductKey),

FOREIGN KEY (CustomerKey) REFERENCES CUSTOMER(CustomerKey)

);

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 Programming Questions!