Skip to content

A collection of SQL query examples and exercises to practice database queries, including real-world scenarios like customer transactions, product sales, employee records, and more. This repository is useful for learning SQL, improving query skills, and preparing for database-related interviews.

Notifications You must be signed in to change notification settings

hilalahmad0101/sql-queries-examples

Repository files navigation

SQL Queries & Exercises 📊

A collection of SQL query examples and exercises to enhance your database querying skills. This repository contains real-world SQL problems covering customer transactions, product sales, employee records, and more. Perfect for learning SQL, preparing for interviews, or practicing database management.

📌 Table of Contents

🚀 Introduction

This repository is a curated collection of SQL queries ranging from beginner to advanced levels. The queries are designed to help you:
✅ Improve your SQL skills
✅ Understand complex queries and optimizations
✅ Prepare for SQL-related interviews
✅ Work with different database management systems (MySQL, PostgreSQL, etc.)

📂 SQL Queries

Here are some of the SQL exercises included in this repository:

File Name Description
01_recyclable-and-low-fat-products.sql Find recyclable and low-fat products
02_find_customer.sql Find customers who referred others
03_big_countries.sql Identify big countries
04_articles_views.sql Analyze article views
05_invalid_tweet.sql Detect invalid tweets
06_employee_id.sql Replace Employee ID with a unique identifier
07_product_sale.sql Analyze product sales
08_visited.sql Identify customers who visited but didn't make transactions

More queries will be added soon! 🔥

📖 How to Use

  1. Clone the repository:
    git clone https://github.com/hilalahmad0101/sql-quries-examples.git
  2. Open the SQL files in any SQL editor (MySQL Workbench, PostgreSQL, SQLite, etc.).
  3. Run the queries on a sample database and analyze the results.
  4. Modify and experiment with the queries to deepen your understanding.

🤝 Contributing

Contributions are welcome! If you have an interesting SQL query or optimization technique, feel free to open a pull request.

How to contribute:

  1. Fork this repository
  2. Add your SQL query in a new file following the existing format
  3. Create a pull request

📜 License

This project is licensed under the MIT License – feel free to use, modify, and share.

🏷 Tags

SQL Database SQL Queries SQL Practice SQL Exercises Database Management MySQL PostgreSQL SQL Interview Questions Data Analysis SQL Examples

About

A collection of SQL query examples and exercises to practice database queries, including real-world scenarios like customer transactions, product sales, employee records, and more. This repository is useful for learning SQL, improving query skills, and preparing for database-related interviews.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published