In this project, I explored the World database, a commonly used dataset for practicing SQL queries. This dataset provides information on countries, cities, and populations, making it a great resource for data analysts to sharpen their MySQL skills.
The World database is essential for data analysts and SQL learners because it:
- Offers real-world data on countries, cities, and population statistics.
- Allows practice with key SQL concepts such as JOINs, filtering, ordering, and aggregation.
- Helps in building data-driven insights into global demographic trends.
Below are some of the SQL queries I worked on, along with their insights:
SELECT city.name
FROM city
JOIN country ON city.id = country.capital
WHERE country.name = 'Spain';
Insight: This query finds the capital city of Spain by joining the city and country tables using the capital
field.
SELECT city.name
FROM city
JOIN country ON city.id = country.capital
WHERE continent = 'Europe'
ORDER BY name;
Insight: This query provides a sorted list of European capital cities, making it easier to analyze geographical distributions.
SELECT name, AVG(population) AS 'Average'
FROM country
GROUP BY name
ORDER BY AVG(population) DESC;
Insight: This query calculates the average population per country and sorts them in descending order, highlighting the most populous countries.
If you'd like to explore this dataset and SQL queries yourself, follow these steps:
- Download the World database from MySQL Sample Databases.
- Import it into your MySQL environment.
- Run the provided SQL queries to analyze the data.
- Modify and expand queries to uncover more insights!
- Learned how to join tables to extract meaningful relationships.
- Practiced filtering, sorting, and aggregating data.
- Developed insights into population trends and geographic distributions.
π’ Feel free to fork this repository and try out the queries yourself. Let's keep learning and growing in data analysis! π