Click here to Skip to main content
11,635,053 members (72,918 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: GimmeCode Homework
For each continent show the continent and number of countries with populations of at least 10 million.

world(name, continent, area, population, gdp)

my answer is :
select continent, count(name) from world
group by continent
having Min(population)>=10000000
what is the Correct Anwer?!

Edit: moved over to the GimmeCodezz/Homework section. - Marco Bertschi
Posted 5-May-13 8:06am
Edited 5-May-13 10:26am
Maciej Los at 5-May-13 14:24pm
Please, be more specific and provide more details (example data). Use "Improve question" widget.

Query look correct!
ThePhantomUpvoter at 5-May-13 14:28pm
What is the problem?
ridoy at 5-May-13 15:55pm
I think that is good enough.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Your query is just about correct as it stands... just one thing isn't quite right.

The "having" clause is only required when you are wanting to perform some operation over set functions, eg: sum(X), min(Y), count(Z) etc... this is not required in this case. A simple where clause will suffice - try doing that and get back to us if you still can't get it working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 8,861
1 Sergey Alexandrovich Kryukov 8,459
2 Mika Wendelius 6,849
3 F-ES Sitecore 2,354
4 Suvendu Shekhar Giri 2,270

Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 6 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100