Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Programming questions

Question

Write each fraction as a percent. 7 50

Answered: 1 week ago