Question: 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

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 the month is January.

the things is...date form is as attached picture below from sales table. and my result can not retrieves matching date which is January 2011 belongs to.

write a query to create a new table, Profit_Table, with variables date,

If I write query as...below, it will have result, but I need that WHERE clause.

sub_category, country, customer_age, and profit from the sales, product, and location tables

result will shows.. as...

where the year is 2011 and the month is January. the thingsif I add

WHERE month = ' January' AND year =2011 ;

there is no result show up at all.

is...date form is as attached picture below from sales table. and myLast, do I need set key? primary key or foreign key? for which column?

Thank you.

\( \begin{array}{ll}1 & \text { CREATE TABLE Profit_Table AS } \\ 2 & \text { SELECT date, customer_age, profit, country, sub_category } \\ 3 & \text { FROM sales } \\ 4 & \text { INNER JOIN location ON sales.Location = location.LOC_ID } \\ 5 & \text { INNER JOIN product oN sales.Product = product.SKU; }\end{array} \) Date Customer_Age Profit Country Sub_Category

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 General Management Questions!