SQL Database Querying: The Movie Database
An introductory course designed for absolute beginners to learn foundational SQL database querying. Using a practical Movie and Rating database, learners will master data retrieval, filtering, joining tables, and basic aggregation.
Introduction to Relational Databases Define the basic structure of a relational database, including tables, rows, and columns. Identify the structure and purpose of the Movie and Rating tables.
Understanding Keys and Relationships Explain the purpose of a Primary Key in uniquely identifying records. Identify the Foreign Key relationship between the Movie and Rating tables.
Introduction to SQL Syntax Describe what SQL is and why it is used in data analysis. Recognize the basic structure and execution order of a standard SQL query.
The SELECT Statement Write a basic SELECT query to retrieve all columns from a table. Write a SELECT query to retrieve specific columns, such as Title and Year, from the Movie table.
Filtering Data with WHERE Apply the WHERE clause to filter rows based on a single condition. Use basic comparison operators (=, <, >) to find movies from specific years.
Expanding Filters with AND & OR Combine multiple filtering conditions using the AND and OR operators. Write a query to filter text data, such as finding movies of a specific Genre.
The Concept of Joining Tables Explain why JOIN operations are necessary in relational databases. Visualize how rows merge based on matching primary and foreign keys.
Writing INNER JOIN Queries Write a standard INNER JOIN statement. Match movies with their rating descriptions using RatingCode and Code.
Selecting Columns from Joined Tables Retrieve specific columns from multiple joined tables. Resolve ambiguous column names by explicitly referencing the table name.
Aggregating Data with COUNT() Explain the purpose of aggregate functions in SQL. Use the COUNT() function to find the total number of rows in the Movie table.
Organizing Data with GROUP BY Use the GROUP BY clause to categorize data. Calculate aggregations per category, such as the number of movies per Genre.
Putting It All Together Combine SELECT, JOIN, WHERE, and GROUP BY clauses in a single query. Solve a comprehensive data retrieval scenario using the full Movie Database schema.