I was asked this question in an interview and I could not get my mind around it, and now it is bothering me a lot!
If you have a table CANADA(PROVINCE, CITY, POPULATION). - Population is correlated with the population of one city. - There are multiple cities in a province.
Question: Write a query that would list the total population of each Province.
I am a beginner when it comes to SQL related questions. Knoweldge of SQL was not in my job description, but they just wanted to know if I could solve it.
I came up with this: SELECT PROVINCE, POPULATION WHERE CANADA GROUP BY PROVINCE
However I did not know how to move forward with this. I would like to know of I am going the right direction please!