> For the complete documentation index, see [llms.txt](https://dshub.gitbook.io/ds-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dshub.gitbook.io/ds-hub/sql/sql-practice/popular-websites-for-sql-practice/sqlzoo/world-bbc-tables/select-quiz.md).

# Select Quiz

world table

[Link](https://sqlzoo.net/wiki/SELECT_Quiz)

## **World Table:**

| 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 |
| ...         | ...       | ...     | ...        | ...          |

1\. Select the code which produces this table

| name        | population |
| ----------- | ---------- |
| Bahrain     | 1234571    |
| Swaziland   | 1220000    |
| Timor-Leste | 1066409    |

<pre class="language-sql"><code class="lang-sql">SELECT name, population
  FROM world
<strong> WHERE population BETWEEN 1000000 AND 1250000
</strong></code></pre>

2. Pick the result you would obtain from this code:

```sql
SELECT name, population
  FROM world
 WHERE name LIKE "Al%"
```

| Albania | 3200000  |
| ------- | -------- |
| Algeria | 32900000 |

3. Select the code which shows the countries that end in A or L

```sql
SELECT name FROM world
 WHERE name LIKE '%a' OR name LIKE '%l'
```

4. Pick the result from the query

   ```sql
   SELECT name,length(name)
     FROM world
    WHERE length(name)=5 and region='Europe'
   ```

| name  | length(name) |
| ----- | ------------ |
| Italy | 5            |
| Malta | 5            |
| Spain | 5            |

5. Here are the first few rows of the world table:

| name        | region      | area    | population | gdp         |
| ----------- | ----------- | ------- | ---------- | ----------- |
| Afghanistan | South Asia  | 652225  | 26000000   |             |
| Albania     | Europe      | 28728   | 3200000    | 6656000000  |
| Algeria     | Middle East | 2400000 | 32900000   | 75012000000 |
| Andorra     | Europe      | 468     | 64000      |             |
| ...         |             |         |            |             |

Pick the result you would obtain from this code:

```sql
SELECT name, area*2 FROM world WHERE population = 64000
```

|         |     |
| ------- | --- |
| Andorra | 936 |

6. Select the code that would show the countries with an area larger than 50000 and a population smaller than 10000000

```sql
SELECT name, area, population
  FROM world
 WHERE area > 50000 AND population < 10000000
```

7. Select the code that shows the population density of China, Australia, Nigeria and France

```sql
SELECT name, population/area
  FROM world
 WHERE name IN ('China', 'Nigeria', 'France', 'Australia')
```

<br>
