SQL query [message #673016] |
Thu, 01 November 2018 20:39 |
|
james94539
Messages: 4 Registered: November 2018
|
Junior Member |
|
|
Hi,
Can anyone help to write SQL queries?
Thanks
James
Given 2 tables, Table1 with Customer_ID, Product_ID, Date, Country & Revenue & Table2 with Product_ID & Product_Name ,write a SQL query to get the Total Revenue by Product_Name and Country?
|
|
|
|
Re: SQL query [message #673019 is a reply to message #673016] |
Fri, 02 November 2018 01:21 |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
Hi James. This looks a LOT like a homework assignment, which implies that you are studying SQL as part of a course.
Have you had a crack at writing the query? If you have, post what you tried and folk here will happily help to guide you. If you haven't, read your notes and give it a try, then post what you tried and folk here will happily help to guide you.
GL
|
|
|
Re: SQL query [message #673022 is a reply to message #673016] |
Fri, 02 November 2018 02:35 |
|
Michel Cadot
Messages: 68694 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Hint in 2 steps:
1/ first find the total by product_id and country using only table1 (see Aggregate Functions)
2/ then join the result of this (sub)query with table2 to get product_name from product_id
|
|
|