This project explores a DVD rental database using SQL to answer a series of increasingly complex business questions.
The goal is to demonstrate SQL skills, from simple queries (DISTINCT) to advanced concepts like subqueries, CASE statements, JOINs, and correlated queries.
- Showcase SQL query writing across multiple difficulty levels.
- Extract business insights about customers, films, revenue, and categories.
- Demonstrate data analysis techniques useful in real-world scenarios.
- SQL (tested in PostgreSQL)
queries/– contains SQL scripts for each questionanalysis.md– answers with SQL code and explanationsREADME.md– project overview
- Task: List all distinct replacement costs of the films.
- Insight: Lowest replacement cost is 9.99.
- Task: Classify films into low, medium, high replacement cost ranges.
- Insight: 514 films fall into the "low" group.
- Task: Find the longest film in Drama or Sports.
- Insight: Longest film is in Sports, with a length of 184 minutes.
- Task: Count how many films are in each category.
- Insight: Sports is the most common with 74 titles.
- Task: Count how many films each actor appears in.
- Insight: Susan Davis appears in the most films (54).
- Task: Find addresses with no associated customers.
- Insight: There are 4 addresses with no customer.
- Task: Find the city with the most sales (by customer location).
- Insight: Cape Coral with 221.55 total sales.
- Task: Calculate revenue grouped by country, city.
- Insight: Lowest sales: United States, Tallahassee (50.85).
- Task: Average revenue per customer for each staff.
- Insight: Staff ID 2 has the higher average (56.64).
- Task: Calculate daily average revenue for all Sundays.
- Insight: 1410.65.
- Task: List films longer than the average in their replacement cost group.
- Insight: Shortest on this list are Celebrity Horn and Seattle Expectations (110 minutes).
- Task: Average customer lifetime value grouped by district.
- Insight: Highest is Saint-Denis (216.54).
- Task: Payments with category and total category revenue.
- Insight: Action total revenue is 4375.85, lowest payment_id is 16055.
- Task: Find the top revenue film in each category.
- Insight: Best in Animation is Dogma Family (178.70).
- Demonstrated SQL skills from beginner to advanced.
- Extracted actionable business insights from a DVD rental database.
- Organized the project for portfolio showcase.