Question
Star Schema Script: create table DimSuppliers ( supplier_id int primary key, supplier_name varchar(30)) create table DimDates ( date_id int primary key, month varchar(10), year varchar(10))
Star Schema Script:
create table DimSuppliers (
supplier_id int primary key,
supplier_name varchar(30))
create table DimDates (
date_id int primary key,
month varchar(10),
year varchar(10))
create table DimCustomers (
customer_id int primary key,
state varchar(30),
zip varchar(12))
create table DimPayments (
payment_id int primary key,
supplier_id int,
customer_id int,
date_id int,
payment_amount money,
foreign key (supplier_id) references DimSuppliers(supplier_id),
foreign key (customer_id) references DimCustomers(customer_id),
foreign key (date_id) references DimDates(date_id))
create table FactBid (
bid_id int primary key,
customer_id int,
date_id int,
bid_amount money,
foreign key (customer_id) references DimCustomers(customer_id),
foreign key (date_id) references DimDates(date_id))
Question:
Using your populated star schema, create DML select statements for the following requirements.
Return the total bid dollar amount by customer zip code.
Return the avg bid dollar amount by customer state.
Return the total bid dollar amount by month.
Return the total bid dollar amount by customer zip code having a total bid dollar amount greater than $100.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started