I’m learning SQL and I’m stuck on a question

This is the site I’m using to learn the language: https://sqlzoo.net/wiki/SELECT_from_WORLD_Tutorial

Question 10 says:

Show the name and per-capita GDP for those countries with a GDP of at least one trillion (1000000000000; that is 12 zeros). Round this value to the nearest 1000 (I have a feeling that this is the part I’m messing up on). Show per-capita GDP for the trillion dollar countries to the nearest $1000.

This is my code but I can’t figure out why it doesn’t work:

SELECT name, ROUND(gdp / population, 0) AS 'per-capita GDP' FROM world WHERE gdp >= 1000000000000; 

submitted by /u/ferengiprophet
[link] [comments]


Go to Source of this post
Author Of this post: /u/ferengiprophet
Title Of post: I’m learning SQL and I’m stuck on a question
Author Link: {authorlink}