- In this exercise, I worked on a variety of SQL queries using both the CITY and STATION (Weather Observation Station) tables. This helped me build a strong foundation in database querying and data analysis.
I began with basic queries such as retrieving all columns from the CITY table and gradually moved to more specific tasks like filtering cities based on country codes such as USA and JPN. I also learned how to extract only required fields like city names and apply conditions based on population.
In addition to city-based queries, I explored weather-related datasets using the STATION table. ~ For example, I learned how to extract only American cities with populations greater than a certain threshold and how to retrieve only specific columns like city names.
One interesting problem I solved involved retrieving a list of city names that do not start with vowels. To achieve this, I used multiple NOT LIKE conditions along with the DISTINCT keyword to ensure that duplicate entries were removed. This helped me better understand pattern matching and string filtering in SQL.
~ One key concept I practiced was eliminating duplicate data using the DISTINCT keyword. For example, I solved a problem where I calculated the difference between the total number of city entries and the number of unique city names. This gave me insight into how duplicate data can affect analysis.
Overall, this hands-on SQL practice enhanced my understanding of:
~Data retrieval using SELECT
~Filtering using WHERE conditions
~Working with multiple datasets
~Handling duplicates using DISTINCT


Top comments (0)