Practice Interview Questions
| Question | Status |
|---|---|
You're currently working on a data analysis project at Deloitte, focusing on a dataset containing information about different cities.
Your objective is to compute the population density for each city, using the formula (Population / Area), and round the result to the nearest integer. Ensure that ties in population density are accounted for by including all cities with the same density in the results.
Additionally, order the cities by population density, from highest to lowest, and identify the cities with the minimum and maximum population densities.
cities_population table:
| Column Name | Description |
|---|---|
| city | Name of the city |
| country | Name of the country |
| population | Number of population |
| area | Area of the city |
Example output:
| city | country | density |
|---|---|---|
| Rivertown | Plainsland | 20 |
| Gotham | Islander | 5000 |
You're currently working on a data analysis project at Deloitte, focusing on a dataset containing information about different cities.
Your objective is to compute the population density for each city, using the formula (Population / Area), and round the result to the nearest integer. Ensure that ties in population density are accounted for by including all cities with the same density in the results.
Additionally, order the cities by population density, from highest to lowest, and identify the cities with the minimum and maximum population densities.
cities_population table:
| Column Name | Description |
|---|---|
| city | Name of the city |
| country | Name of the country |
| population | Number of population |
| area | Area of the city |
Example output:
| city | country | density |
|---|---|---|
| Rivertown | Plainsland | 20 |
| Gotham | Islander | 5000 |