Question: SQL. Using the data below, please answer these questions 1. Find the number of Amazon stores by state by year 2. Find the number of
SQL. Using the data below, please answer these questions
1. Find the number of Amazon stores by state by year
2. Find the number of target stores by year
3. Use code to find the number of Toy department by year
4. Use code to find the number of Home department by year
5. Create a new table that has year, number of Toy department and number of Home department
Create table shopping (
date varchar(255).
code varchar(255),
department varchar(255),
store varchar(255),
state varchar(255)
)
Example values,
Insert into shopping values ("05/03/2018", "A1", "Music", "Amazon", "NC"), ("04/25/2018", "B2", "Home", "Amazon", "NY"), ("12/21/2018", "A1", "Toy", "Target", "MD"), ("01/30/2017". "B2", "Office", "Walmart", "SC"), ("09/17/2017", "A1", "Toy", "Amazon", "NC"), ("09/07/2018", "B2", "Toy", "Walmart", "NY"), ("08/27/2017", "A1", "Toy", "Target", "NC"), ("02/11/2018", "B2", "Home", "Target", "NC")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
