Beginner to Advanced ⏱ 15 Hours 📚 4 Lessons & Labs ⭐ Comprehensive Curriculum

🗄️ SQL Relational Database & Querying

Master relational database theory, database normalization (1NF-3NF), multi-table JOINs, aggregate grouping, subqueries, CTEs, and B-Tree indexing.

Beginner • Chapter 1: Relational Modeling & Essential Queries
⏱ 10 min 📈 Beginner

Relational Theory, SELECT & Filtering

Learn how relational databases store tabular data, how primary/foreign keys enforce integrity, and how to query with SELECT and WHERE.

The Foundations of Relational Databases

Structured Query Language (SQL) is the universal standard for defining, querying, and updating relational database management systems (RDBMS) like PostgreSQL, MySQL, and SQLite.

Core Relational Integrity Rules

  • Primary Key (PK): Unique non-null identifier for every row in a table.
  • Foreign Key (FK): References the primary key of another table, ensuring referential integrity.
SQL
-- Filter high-enrollment active courses
SELECT 
    course_id,
    course_name,
    category,
    enrolled_count
FROM courses
WHERE is_published = 1 
  AND enrolled_count >= 500
ORDER BY enrolled_count DESC
LIMIT 10;
💻 Interactive Sandbox Playground (SQL)
Editor Input
Console Output
Press "Run Code" to execute in virtual runtime.
Next: Mastering INNER, LEFT, RIGHT JOINs & GROUP BY →
Intermediate • Chapter 2: Multi-Table JOINs & Aggregations
⏱ 14 min 📈 Intermediate

Mastering INNER, LEFT, RIGHT JOINs & GROUP BY

Connect disparate data tables seamlessly and compute meaningful metrics with aggregate functions and HAVING filters.

Combining Relations with JOIN Operations

In normalized databases, data is split across specialized tables to prevent duplication. JOIN operations allow you to assemble rich composite reports on demand:

SQL
SELECT 
    u.username,
    c.course_name,
    e.enrollment_date,
    e.completion_percentage
FROM enrollments e
INNER JOIN users u ON e.user_id = u.id
INNER JOIN courses c ON e.course_id = c.id
WHERE e.completion_percentage = 100
ORDER BY e.enrollment_date DESC;
💻 Interactive Sandbox Playground (SQL)
Editor Input
Console Output
Press "Run Code" to execute in virtual runtime.
Quiz • Chapter 3: Knowledge Assessment Quiz
⏱ 6 min 📈 All Levels

SQL Relational Mastery Quiz

Test your understanding of JOIN mechanics, GROUP BY constraints, and index utilization.

📝 SQL Relational Mastery Quiz
Score: 0 / 1
Question 1: What is the main difference between WHERE and HAVING in SQL?
Projects • Chapter 4: Real-World Capstone Projects
⏱ 15 min 📈 Advanced

SQL Database Architecture Projects

Build an E-Commerce Analytics Query Suite and design a normalized University Schema.

Project 1: E-Commerce Revenue & Retention Query Suite

Intermediate

Write an analytical query suite calculating Monthly Recurring Revenue (MRR), Average Order Value (AOV), and customer churn rates.

Production Blueprint
SELECT 
    DATE_FORMAT(order_date, '%Y-%m') as sales_month,
    COUNT(order_id) as total_orders,
    SUM(total_amount) as gross_revenue
FROM orders
GROUP BY sales_month
ORDER BY sales_month DESC;

Project 2: University Course Enrollment Database Schema

Advanced

Design a 3NF relational schema covering students, professors, courses, prerequisites, and grade transcripts with appropriate B-Tree indexing.

Production Blueprint
CREATE TABLE students (
    student_id INT AUTO_INCREMENT PRIMARY KEY,
    first_name VARCHAR(50) NOT NULL,
    email VARCHAR(100) UNIQUE NOT NULL
);
← Previous: SQL Relational Mastery Quiz