You are on page 1of 10

Attempt 01

(Store-Region) What is the average sales of Desktop CPU in the East at store 7?
Answer:
47313.88333
Feedback
SQL Aggregate

SELECT `Item_Description`,`Store_No`, `Sales_Region`, avg(`Total_Sales`) from sales where


`Item_Description`= 'Desktop CPU' and `Sales_Region`='east' and `Store_No`=7

SQL JOIN

SELECT sales_region.region, AVG(sales.S_amount), sales_region.Store_no,products.p_name


from sales

join products on sales.Product_no= products.p_id

join sales_region on sales.store_no = sales_region.Store_no

where products.p_name = 'Desktop CPU' and sales_region.region='east' and sales.store_no =7

The correct answer is: 47313.5


Question 2
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
(Store-Region) What is the total sales of 101 Keyboard in the East at store 7?
Answer:
2872.8
Feedback
SQL Aggregate

SELECT `Item_Description`,`Store_No`, `Sales_Region`, sum(`Total_Sales`) from sales where


`Item_Description`= '101 Keyboard' and `Sales_Region`='east' and `Store_No`=7

SQL Join

SELECT sales_region.region, sum(sales.S_amount), sales_region.Store_no,products.p_name


from sales
join products on sales.Product_no= products.p_id

join sales_region on sales.store_no = sales_region.Store_no

where products.p_name = '101 Keyboard' and sales_region.region='East' and sales.store_no=7

The correct answer is: 957.6


Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
(Store-Region) What is the average sales of Desktop CPU in the North?
Answer:
33148.05
Feedback
SQL Aggregate

SELECT `Item_Description`, `Sales_Region`, avg(`Total_Sales`) from sales where


`Item_Description`= 'Desktop CPU' and `Sales_Region`='north'

SQL JOIN

SELECT sales_region.region, AVG(sales.S_amount), products.p_name from sales

join products on sales.Product_no= products.p_id

join sales_region on sales.store_no = sales_region.Store_no

where products.p_name = 'Desktop CPU' and sales_region.region='north'

The correct answer is: 33148.25


Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
(Store-Region) How many sales occured more than $ 2,000 on 24-11-2008 at north??
Answer:
4
Feedback
SQL Aggregate
SELECT `Sales_Region`,`Week_Ending`, COUNT(`Total_Sales`) from sales where `Week_Ending`=
'24-Nov-08' and `Sales_Region`='north' AND `Total_Sales`>2000

SQL JOIN

SELECT sales.S_date, sales_region.region, COUNT(sales.S_amount) from sales

join sales_region on sales.store_no = sales_region.Store_no

where sales.S_date= '24-nov-08' AND sales_region.region ='north' AND sales.S_amount>'2000'

The correct answer is: 4


Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
(Store-Region) What is the average sales of Desktop CPU in the North at store 5?
Answer:
45047.35
Feedback
SQL Aggregate

SELECT `Item_Description`,`Store_No`, `Sales_Region`, avg(`Total_Sales`) from sales where


`Item_Description`= 'Desktop CPU' and `Sales_Region`='north' and `Store_No`=5

SQL JOIN

SELECT sales_region.region, AVG(sales.S_amount), sales_region.Store_no,products.p_name


from sales

join products on sales.Product_no= products.p_id

join sales_region on sales.store_no = sales_region.Store_no

where products.p_name = 'Desktop CPU' and sales_region.region='north' and sales.store_no =5

The correct answer is: 45047.25


Attempt 02
(Store-Region) What is the average sales of 101 Keyboard in the East at store 7?
Answer:
957.6
Feedback
SQL Aggregate

SELECT `Item_Description`,`Store_No`, `Sales_Region`, avg(`Total_Sales`) from sales where


`Item_Description`= '101 Keyboard' and `Sales_Region`='east' and `Store_No`=7

SQL Join

SELECT sales_region.region, AVG(sales.S_amount), sales_region.Store_no,products.p_name


from sales

join products on sales.Product_no= products.p_id

join sales_region on sales.store_no = sales_region.Store_no

where products.p_name = '101 Keyboard' and sales_region.region='East' and sales.store_no=7

The correct answer is: 957.6


Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
(Store-Region) How many sales occurred for east more than $1000?
Answer:
21
Feedback
SQL Aggregate
SELECT `Sales_Region`,COUNT(`Total_Sales`) from sales where `Total_Sales`>1000 and
`Sales_Region`= 'east'

SQL JOIN

SELECT sales_region.region, COUNT(sales.S_amount) from sales

join sales_region on sales.store_no = sales_region.Store_no


where sales_region.region ='east' AND sales.S_amount>'1000'

The correct answer is: 21


Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
(Store-Region) How many 17 Monitor sales were more than $1000 in the north region?
Answer:
5
Feedback
SQL Aggregate

SELECT `Item_Description`, `Sales_Region`, COUNT(`Total_Sales`) from sales where


`Item_Description`= '17 Monitor' and `Sales_Region`='north' AND `Total_Sales`>1000

SQL JOIN

SELECT products.p_name, sales_region.region, COUNT(sales.S_amount) from sales

join products on sales.Product_no = products.p_id

join sales_region on sales.store_no = sales_region.Store_no

where products.p_name= '17 Monitor' AND sales_region.region ='north' AND


sales.S_amount>'1000'

The correct answer is: 5


Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
(Store-Region) What is the total sales of 101 Keyboard in the east?
Answer:
7680.75
Feedback
SQL Aggregate

SELECT `Item_Description`,`Sales_Region`, sum(`Total_Sales`) from sales where


`Item_Description`= '101 Keyboard' and `Sales_Region`='east'

SQL JOIN
SELECT sales_region.region, sum(sales.S_amount), products.p_name from sales

join products on sales.Product_no= products.p_id

join sales_region on sales.store_no = sales_region.Store_no

where products.p_name = '101 Keyboard' and sales_region.region='East'

The correct answer is: 7680.75


Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
(Store-Region) What is the average sales of 17 Monitor in the South at store 1?
Answer:
5114.333333
Feedback
SQL Aggregate

SELECT `Item_Description`,`Store_No`, `Sales_Region`, avg(`Total_Sales`) from sales where


`Item_Description`= '17 Monitor' and `Sales_Region`='south' and `Store_No`=1

SQL JOIN

SELECT sales_region.region, AVG(sales.S_amount), sales_region.Store_no,products.p_name


from sales

join products on sales.Product_no= products.p_id

join sales_region on sales.store_no = sales_region.Store_no

where products.p_name = '17 Monitor' and sales_region.region='south' and sales.store_no =1

The correct answer is: 5114.17


Attempt 03

(Store-Region) How many sales occurred for north less than $5000?
Answer:
15
Feedback
SQL Aggregate

SELECT `Sales_Region`,COUNT(`Total_Sales`) from sales where `Total_Sales`<5000 and


`Sales_Region`= 'north'

SQL JOIN

SELECT sales_region.region, COUNT(sales.S_amount) from sales

join sales_region on sales.store_no = sales_region.Store_no

where sales_region.region ='north' AND sales.S_amount<'5000'

The correct answer is: 15


Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
(Store-Region) What is the average sales of 17 Monitor in the North?
Answer:
4465.5
Feedback
SQL Aggregate

SELECT `Item_Description`,`Sales_Region`, avg(`Total_Sales`) from sales where


`Item_Description`= '17 Monitor' and `Sales_Region`='north'

SQL JOIN

SELECT sales_region.region, AVG(sales.S_amount), products.p_name from sales

join products on sales.Product_no= products.p_id

join sales_region on sales.store_no = sales_region.Store_no


where products.p_name = '17 Monitor' and sales_region.region='north'

The correct answer is: 4465.25


Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
(Store-Region) What is the average sales of 101 Keyboard in the North at store 5?
Answer:
1576.05
Feedback
SQL Aggregate

SELECT `Item_Description`,`Store_No`, `Sales_Region`, avg(`Total_Sales`) from sales where


`Item_Description`= '101 Keyboard' and `Sales_Region`='north' and `Store_No`=5

SQL JOIN

SELECT sales_region.region, AVG(sales.S_amount), sales_region.Store_no,products.p_name


from sales

join products on sales.Product_no= products.p_id

join sales_region on sales.store_no = sales_region.Store_no

where products.p_name = '101 Keyboard' and sales_region.region='north' and sales.store_no


=5

The correct answer is: 1576.25


Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
(Store-Region) What is the average sales of pc mouse in the South at store 1?
Answer:
205.85
Feedback
SQL Aggregate
SELECT `Item_Description`,`Store_No`, `Sales_Region`, avg(`Total_Sales`) from sales where
`Item_Description`= 'PC Mouse' and `Sales_Region`='south' and `Store_No`=1

SQL JOIN

SELECT sales_region.region, AVG(sales.S_amount), sales_region.Store_no,products.p_name


from sales

join products on sales.Product_no= products.p_id

join sales_region on sales.store_no = sales_region.Store_no

where products.p_name = 'PC Mouse' and sales_region.region='south' and sales.store_no =1

The correct answer is: 205.5


Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
(Store-Region) How much money we need if we pay $500 to the sales manager for sales
occured more than $ 2,000 on 24-11-2008 at north region?
Answer:
1000
Feedback
SQL Aggregate

SELECT DISTINCT`Store_No`,Sales_Region, count(`Total_Sales`) from sales WHERE


`Week_Ending`='24-nov-08' and `Total_Sales`>2000 and Sales_Region='north' GROUP by
Store_No

2*500 = 1000

SQL JOIN

SELECT DISTINCT sales_region.Store_no,Sales_Region.region from sales

join sales_region on sales.store_no = sales_region.Store_no

WHERE sales.S_date='24-nov-08' and sales.S_amount>2000 and sales_region.region='north'


GROUP by sales_region.Store_no
The correct answer is: 1000

You might also like