The video documents a data analysis session focused on SQL joins. Here is the chronological summary:

  • Setup and Data Preparation: The session begins with participants downloading three datasets: Customer Profile, Product, and Purchase History. The speaker guides the group through creating a new schema and importing these files, emphasizing the need to clean filenames and ensure they are housed within the same schema.
  • Data Modeling and Primary Keys:The speaker explains the “star schema” concept, identifying the Purchase History dataset as the “fact table” and the Customer Profile and Product datasets as “dimension tables”. Participants are then instructed to use the “alter table” function to define primary keys—Customer ID for the Customer Profile table, Product ID for the Product table, and a combination of keys for the Purchase History table—to enable proper data relationships.
  • Understanding SQL Joins: The speaker defines the different types of joins (Inner, Left, Right, and Full) and notes that Inner Join is the most frequently used for analysis. The session focuses on Inner Join, which returns only matching rows from combined tables.
  • Practical Examples:
    • The group practices writing queries to find the “total amount spent on butter” by performing an inner join between the Product and Purchase History tables, emphasizing the importance of table naming conventions in the script.
    • A second query is attempted to find the “average price of items bought by females,” which requires a “double inner join” using the Purchase History table as a bridge between the Customer Profile and Product datasets.
  • Troubleshooting: Much of the session involves debugging syntax errors, such as incorrect table references, missing brackets, and spelling inconsistencies. The speaker encourages participants to share screens, verify spellings, and use caution when copying scripts.
  • Assignment: The session concludes with five homework questions for the participants to practice:
    1. List the names, items, and emails of customers who bought dairy products.
    2. Find the most profitable five states.
    3. Identify the year with the highest purchases from Arizona.
    4. List the phone numbers of people who bought over four items.
    5. Calculate the total amount made in 2018.