Skip to content

ana-bastardo/sql-challenges-course

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sql-challenges-course

SQL practice repository: joins, subqueries, CTEs, and window functions solved and documented with reasoning, alternative approaches, and notes on mistakes/debugging.

Challenges Index

# Challenge Topic Level
01 Distinct replacement cost DISTINCT Simple
02 Case + group by cost ranges CASE + GROUP BY Moderate
03 Join category length JOIN Moderate
04 Join group by movies per category JOIN & GROUP BY Moderate
05 Join group by actor movie count JOIN & GROUP BY Moderate
06 Left join unassigned addresses LEFT JOIN & FILTERING Moderate
07 Join group by sales by city JOIN & GROUP BY Moderate
08 Join group by revenue by country/city JOIN & GROUP BY Moderate–Difficult
09 Subquery avg revenue per staff Uncorrelated subquery Difficult
10 Extract + subquery avg Sunday revenue EXTRACT + Uncorrelated subquery Difficult–Very difficult
11 Correlated subquery movies above avg length Correlated subquery Difficult–Very difficult
12 Subquery avg customer lifetime value Uncorrelated subquery Very difficult
13 Correlated subquery payments by category Correlated subquery Very difficult
14 Bonus: nested subquery top revenue per category Correlated + uncorrelated (nested) Extremely difficult

Tech used

  • PostgreSQL (managed via pgAdmin 4)

Structure

Each challenge is documented in a single markdown file containing:

  • Problem — paraphrased task and relevant schema
  • Solution — commented SQL query
  • Result — the answer obtained
  • Notes — reasoning, alternative approaches, mistakes made

License

MIT — see LICENSE

About

SQL practice repository: joins, subqueries, CTEs, and window functions solved and documented with reasoning, alternative approaches, and notes on mistakes/debugging.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors