Sakila Database - SQL Query Practice
Overview This project uses the Sakila sample database, which simulates a movie rental store. The database includes tables like film, actor, customer, rental, and category. The goal is to practice SQL queries using this database in MySQL Workbench.
Objectives
- Learn basic SQL queries (SELECT, FROM, WHERE).
- Use aggregation functions (GROUP BY, HAVING).
- Practice joins (INNER JOIN, LEFT JOIN, UNION).
- Work with subqueries and correlated subqueries.
How to Run
- Open MySQL Workbench.
- Load the SQL file: File > Open SQL Script.
- Execute queries and review the results.
Exercises The project includes 25 exercises covering topics like:
- Retrieving unique movie titles.
- Filtering movies by rating or duration.
- Joining tables to find actor and rental details.
- Using subqueries to filter specific results.
- Aggregating data (e.g., rentals per category or average movie length).
Notes Each query is commented for clarity, explaining the logic and SQL methods used.