The CASE statement in SQL

Here is the situation I meet nowadays: This is a very simple database, only including three tables: The students table is the main table. And if a student is a good student, there will be records in StudentsGoods table. Similarly, if a student is a bad student, there will be records in StudentsBads table. I want …

Read More

A SQL exercise

Here is a simple exercise of SQL on SQLZOO.  The table is like this: name continent area population gdp Afghanistan Asia 652230 25500100 20343000000 Albania Europe 28748 2831741 12960000000 Algeria Africa 2381741 37100000 188681000000 Andorra Europe 468 78115 3712000000 Angola Africa 1246700 20609294 100990000000 … The tenth question: Some countries have populations more than three …

Read More