question

sanghyeon avatar image
sanghyeon asked

What is a SQL query to retrieve the total revenue of Nevada Fried Chicken in 2015 and group the data by revenue center?

![alt text][1] [1]: /storage/temp/3791-screen-shot-2016-11-11-at-14418-am.png
joinsum
7 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sorry - I'm not going to provide the exact query. You'll learn nothing that way! The links I've posted above should get you most the way. If you are still running into issues then add the query you've written to your question and and I'm sure someone will help out.
2 Likes 2 ·
Sounds like homework! What have you tried so far?
1 Like 1 ·
Add a WHERE clause to limit the data. WHERE examples with dates can be seen here: http://www.w3schools.com/sql/sql_dates.asp The examples there use equal to, but you can use greater than, less than, between etc. e.g. WHERE date >= '20150101' will limit to all dates greater or equal to Jan 1st 2015, WHERE date BETWEEN '20150101' AND '20151231' will give you all dates between Jan 1st and Dec 31st 2015
1 Like 1 ·
I know it is Join but I am not sure about the next step :(
0 Likes 0 ·
Take a look at this example. Very similar to what you're trying to do. http://www.w3schools.com/sql/sql_groupby.asp
0 Likes 0 ·
How can I get the sum during a certain period of time?
0 Likes 0 ·
Can you show me the query?
0 Likes 0 ·

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.