Skip to content

prayag-verma/Practice-SQL-From-Zero-to-Hero

Repository files navigation

Practice SQL: From Zero to Hero

Welcome to the Practice SQL: From Zero to Hero repository! This collection is designed to help individuals enhance their SQL skills through a series of exercises, each accompanied by schemas, questions, and solutions.

📁 Repository Structure

The repository is organized into directories for each exercise:

Practice-SQL-From-Zero-to-Hero/
├── SQL_exercise_01/
│   ├── SQL_exercise_01_schema_figure.png
│   ├── SQL_exercise_01_build_schema.sql
│   ├── SQL_exercise_01_questions_and_solutions.sql
│   └── ...
├── SQL_exercise_02/
│   ├── SQL_exercise_02_schema_figure.png
│   ├── SQL_exercise_02_build_schema.sql
│   ├── SQL_exercise_02_questions_and_solutions.sql
│   └── ...
├── SQL_exercise_03/
│   ├── SQL_exercise_03_schema_figure.png
│   ├── SQL_exercise_03_build_schema.sql
│   ├── SQL_exercise_03_questions_and_solutions.sql
│   └── ...
├── ...
└── SQL_exercise_10/
    ├── SQL_exercise_10_schema_figure.png
    ├── SQL_exercise_10_build_schema.sql
    ├── SQL_exercise_10_questions_and_solutions.sql
    └── ...

Each exercise directory contains:

  • Schema Diagram (*_schema_figure.png): Visual representation of the database schema.
  • Schema Build Script (*_build_schema.sql): SQL script to create the database schema.
  • Questions and Solutions (*_questions_and_solutions.sql): A set of SQL problems with their corresponding solutions.

📝 Exercises Overview

  1. Exercise 01: Introduction to basic SQL queries.
  2. Exercise 02: Working with JOIN operations.
  3. Exercise 03: Exploring subqueries and nested queries.
  4. Exercise 04: Utilizing aggregate functions.
  5. Exercise 05: Implementing set operations.
  6. Exercise 06: Advanced JOIN techniques.
  7. Exercise 07: Window functions and analytical queries.
  8. Exercise 08: Handling complex subqueries.
  9. Exercise 09: Practical scenarios from real-world applications.
  10. Exercise 10: Advanced topics and optimization techniques.

Note: Exercises 1-8 are adapted from Wikibook SQL Exercises, with solutions provided by both the Wikibook and additional contributions. Exercises 9-10 are original problems inspired by practical experiences.

🚀 Getting Started

To get the most out of these exercises:

  1. Clone the Repository:

    git clone https://github.com/prayag-verma/Practice-SQL-From-Zero-to-Hero.git
    cd Practice-SQL-From-Zero-to-Hero
  2. Set Up the Database:

    • Use the *_build_schema.sql script in each exercise directory to create the necessary tables and insert data.
    • Execute the script in your SQL environment:
      -- Example for Exercise 01
      \i SQL_exercise_01/SQL_exercise_01_build_schema.sql
  3. Attempt the Questions:

    • Open the *_questions_and_solutions.sql file.
    • Try to solve each question on your own before reviewing the provided solutions.

🤝 Contributors

👤 Prayag Verma
👥 Data Engineer

🔗 LinkedIn:linkedin.com/in/prayagv
🔗 Portfolio:prayagverma.com

💬 Feel free to raise an issue or contribute via pull requests!

Contributions are welcome! If you have additional exercises, improvements, or suggestions, please fork the repository and submit a pull request.

📄 License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published