This video details a data analysis class session focused on using SQL to query and filter a “World Economic Classification” dataset.

Session Overview and Data Preparation

Data Setup: The instructor guided students to download the “World Economic Classification” CSV file from the provided Google Drive.

Schema Creation: Students were instructed to create a new database schema named “global data” to house the dataset.

Importing Data: Using the Table Data Import Wizard, students imported the CSV data. The instructor advised cleaning column names of special characters and removing versioning bracketed numbers (e.g., “gen 1”) to ensure the SQL queries functioned correctly.

Key SQL Concepts and Commands

 

The instructor reinforced fundamental best practices and introduced new query commands throughout the session:

Documentation: Emphasis was placed on writing comments before every script using hyphens (–) to define the analysis goal.

Data Query Language (DQL):

SELECT: Used to call specific columns from tables.

FROM: Used to specify the database schema and table location.

WHERE: Used to filter data based on specific conditions.

AND: Used to combine multiple logical conditions that must all be true.

LIKE: Used for pattern matching, paired with % (to find text starting with a specific letter) or _ (to skip characters to find a letter at a specific position).

ORDER BY: Used to arrange data in ascending or descending order.

LIMIT: Used to restrict the number of rows returned.

Practical Analysis Tasks

 

Students performed several analyses, including:

Filtering by Classification: Identifying developed countries that are also classified as “advanced” by the IMF.

Ranking: Extracting the top five oil-exporting countries based on a world rank between 50 and 100.

Pattern Search: Finding countries that start with the letter “L” or contain the letter “L” in specific positions.

Handling Unclassified Data: Querying entries marked as “NA” to find countries that were not classified by either the UN or the IMF.

Troubleshooting

The instructor addressed common errors, such as syntax mistakes caused by missing semicolons, incorrect table naming, and issues with improper data types.

Students were encouraged to copy and paste code rather than typing it manually to avoid hidden character errors.

The instructor noted that “NA” values in the dataset represent missing classifications rather than true “null” values in SQL, which affects how filters should be applied.

Future Outlook

The next class will focus on SQL Joins (Right, Left, Inner, and Full), and students were advised to prepare by reviewing these concepts.