Skip to content

ZeyadGabr1/databases-sql-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Databases SQL Learning

SQL MySQL License

Repository for learning SQL and databases with exercises, queries, and practice projects.


Repository Structure

databases-sql-learning/
│
├── sql_basics/          # SQL fundamentals and basic concepts
├── queries/             # SQL query examples with explanations
└── mysql_projects/      # Complete database projects

SQL Basics

Fundamental SQL concepts with simple explanations:

  • SELECT - Retrieving data from tables
  • WHERE - Filtering data
  • JOIN - Combining data from multiple tables
  • INSERT, UPDATE, DELETE - Modifying data
  • GROUP BY - Grouping and aggregating data
  • ORDER BY - Sorting results
  • Subqueries - Nested queries
  • Functions - Built-in SQL functions
  • Indexes - Performance optimization
  • Views - Virtual tables

Queries

SQL queries organized by difficulty level:

Beginner

  • Simple SELECT statements
  • Basic WHERE conditions
  • Single table operations
  • Basic sorting and filtering

Intermediate

  • Multiple JOINs
  • Subqueries
  • GROUP BY with HAVING
  • String and date functions

Advanced

  • Complex multi-table queries
  • Window functions
  • Query optimization
  • Performance tuning

MySQL Projects

Complete database projects with schemas and queries:

Project Description Status
Library Management Books, members, borrowing system Completed
Online Store Products, orders, customers Completed
Hospital System Patients, doctors, appointments In Progress
School Database Students, courses, grades Planned

Each project includes:

  • Database schema
  • Sample data
  • Common queries
  • Documentation

Getting Started

Prerequisites

  • MySQL 8.0+ or PostgreSQL
  • SQL client (MySQL Workbench, DBeaver, etc.)

Quick Start

  1. Clone the repository:
git clone https://github.com/ZeyadGabr1/databases-sql-learning.git
cd databases-sql-learning
  1. Set up MySQL:
mysql -u root -p
  1. Run a project:
mysql -u root -p < mysql_projects/project-name/schema.sql
mysql -u root -p < mysql_projects/project-name/data.sql
  1. Open API docs at http://localhost:8000/docs

Query Format

Each query includes:

  • Description of what it does
  • Explanation of concepts used
  • Expected output
  • Real-world use case

Example:

-- Get all users who registered this month
SELECT name, email, registration_date
FROM users
WHERE registration_date >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)
ORDER BY registration_date DESC;

Learning Resources


Contributing

Feel free to add queries, projects, or improve documentation.


License

MIT License - see LICENSE file.


Contact

Open an issue or email: [[email protected]]

About

Repository for learning SQL and databases with exercises, queries, and practice projects.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published