Question: SQLite Studio Write a query to create a new table, Profit_Table, with variables date, sub_category, country, customer_age, and profit from the sales, product, and location
SQLite Studio
Write a query to create a new table, Profit_Table, with variables date, sub_category, country, customer_age, and profit from the sales, product, and location tables where the year is 2011 and month is January.
Here is what I have with no data populating
CREATE TABLE Profit_Table AS
SELECT date, sub_category, country, customer_age, profit
FROM Sales
INNER JOIN location ON sales.Location = location.LOC_ID
INNER JOIN Product ON sales.Product = product.SKU
WHERE strftime('%Y', date) = '2011' AND strftime('%m', date) = '01';
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
