Skip to content

drevathi9/sql-mastery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

sql-mastery

Complete SQL mastery with hands-on practice for Software engineers

SQL Mastery in 2 Days ���

Complete hands-on SQL practice guide designed for Test Engineers preparing for technical interviews.

��� What You'll Learn

Day 1: Fundamentals

  • ✅ Basic SELECT, WHERE, ORDER BY
  • ✅ Aggregate Functions (COUNT, SUM, AVG, MIN, MAX)
  • ✅ GROUP BY and HAVING
  • ✅ All JOIN types (INNER, LEFT, RIGHT, FULL)
  • ✅ Subqueries
  • ✅ CASE statements, UNION, Date functions
  • ✅ Window Functions (ROW_NUMBER, RANK, DENSE_RANK)

Day 2: Advanced & Interview Prep

  • ✅ Test data validation queries
  • ✅ Complex multi-table joins
  • ✅ Advanced subqueries and CTEs
  • ✅ 50+ interview questions (Easy → Hard)
  • ✅ Performance optimization
  • ✅ Real-world testing scenarios

��� Sample Database

This repository uses a practice database with these tables:

  • employees - Employee information
  • departments - Department details
  • projects - Project information
  • employee_projects - Many-to-many relationship

��� Getting Started

Prerequisites

  • PostgreSQL installed (or use db-fiddle.com)
  • Basic command line knowledge
  • 2 days of dedicated practice time

Setup Database

# Run the setup script
psql -U postgres -f sample-data/create-tables.sql
psql -U postgres -f sample-data/insert-data.sql

Or use online: Copy contents of sample-data/create-tables.sql to db-fiddle.com

��� 2-Day Study Plan

Day 1 (8-10 hours)

Time Topic Files
Hour 1 Setup & Basics 01-setup-and-basics.sql
Hour 2 Aggregate Functions 02-aggregate-functions.sql
Hour 3 JOINs 03-joins.sql
Hour 4 Subqueries 04-subqueries.sql
Hour 5-6 CASE, UNION, Dates 05-case-union-dates.sql
Hour 7-8 Window Functions 06-window-functions.sql
Evening Practice Complete all Day 1 exercises

Day 2 (8-10 hours)

Time Topic Files
Hour 1-2 Test Data Validation 01-test-data-validation.sql
Hour 3 Complex Queries 02-complex-queries.sql
Hour 4-5 Interview Questions 03-interview-easy.sql, 04-interview-medium.sql
Hour 6-7 Hard Problems 05-interview-hard.sql
Hour 8 Optimization 06-optimization.sql
Evening Mock Interview Practice explaining solutions

��� Interview Preparation

Top 50 Interview Questions

Located in interview-prep/top-50-questions.sql

Categories:

  • Easy (1-15): Basic SELECT, WHERE, GROUP BY
  • Medium (16-35): JOINs, Subqueries, Window Functions
  • Hard (36-50): Complex queries, CTEs, Optimization

Company-Specific Questions

  • FAANG: interview-prep/company-specific/faang-questions.sql
  • Banking/Finance: interview-prep/company-specific/banking-questions.sql
  • FinTech: interview-prep/company-specific/fintech-questions.sql

��� Cheat Sheets

Quick reference guides:

��� Practice Resources

Online SQL Editors

Practice Platforms

��� Tips for Success

  1. Type every query - Don't copy-paste, muscle memory matters
  2. Understand, don't memorize - Know why queries work
  3. Practice explaining - You'll need to explain your logic in interviews
  4. Time yourself - Interview questions have time limits
  5. Review mistakes - Learn from errors

��� After Completing This Repository

You will be able to:

  • ✅ Write complex SQL queries confidently
  • ✅ Handle any SQL question in technical interviews
  • ✅ Validate test data effectively
  • ✅ Optimize query performance
  • ✅ Explain your thought process clearly

��� Progress Tracking

  • Day 1 - All fundamentals completed
  • Day 1 - All exercises solved
  • Day 2 - Advanced topics completed
  • Day 2 - All exercises solved
  • Solved 30+ LeetCode SQL problems
  • Completed mock interview practice
  • Can explain top 20 interview questions

��� Contributing

Found a bug or have suggestions? Feel free to open an issue or submit a pull request!

��� License

This repository is for educational purposes. Feel free to use and share!

���‍��� Author

Created by Revathi Devineni - Test Engineer specializing in QA Automation


⭐ Star this repo if you find it helpful!

��� Questions? Open an issue or reach out!

Happy Learning! ���#

About

Complete SQL mastery with hands-on practice for Software engineers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors