1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
| use world;
select * from country;
select code, name, continent, population from country;
select countrycode as code, name from city;
select code, name, population from country where population >= 100000000;
select name, surfaceArea, population, population / surfacearea as pps from country;
select name, gnp, population, gnp / population * 1000000 as gpp from country;
select name, population from city where population >= 800*10000;
select name, population from country where population >= 800*10000 and population <= 1000*10000;
select name, population from country where population between 800*10000 and 1000*10000;
select name, continent from country where continent = 'asia' OR continent = 'africa';
select name, continent from country where continent in ('asia', 'africa');
select name, governmentform from country where govermentform like "%Republic%";
select code, name from country where code like "ar%";
select code, name, gnp from country order by gnp asc;
select code, name, gnp from country order by gnp desc;
select countrycode, name, population from city order by countrycode desc, population asc;
select name, population from country order by population desc limit 5;
select name, population from country order by population desc limit 5, 4;
select distinct continent from country
|