CoursesData & AISQL & Databases

SQL past the basics, then MongoDB and Redis.

For people who can write a SELECT with a join and want the rest. You write window functions and WITH queries on a shop’s database, design tables and practice SQL interview questions. Then you learn when MongoDB or Redis fits better.

You type every line A real checker runs your code Nothing to install
Lessons
66
Chapters
7
Language
Python
Level
Intermediate
Interview questions
28
Free
The first chapter
Before you start
SELECT, WHERE, GROUP BY and a join.

What you build

Reports with window functions

Top 2 per category, running totals, and each row compared with the one before.

Tables with the rules built in

Many-to-many tables, CHECK and UNIQUE, and views.

MongoDB queries

Filters, nested fields and an aggregation pipeline.

A cache and a leaderboard in Redis

Keys that expire, hashes, lists and sorted sets.

Tools and topics

Syllabus

New to SQL? Start with the 30 SQL lessons of the Backend path, from your first SELECT to joins, indexes and transactions. Start there

00SQL basics, in the Backend path30 lessons
  1. Your First Query
  2. Choose the Columns
  3. Filter Rows with WHERE
  4. AND and OR
  5. IN and BETWEEN
  6. Match Text with LIKE
  7. Missing Values: NULL
  8. Sort with ORDER BY
  9. LIMIT and OFFSET
  10. Distinct Values
  11. Count Rows
  12. SUM, AVG, MIN, MAX
  13. Group Rows with GROUP BY
  14. Filter Groups with HAVING
  15. Name Columns with AS
  16. Add Rows with INSERT
  17. Change Rows with UPDATE
  18. Remove Rows with DELETE
  19. Create a Table
  20. Primary Keys and Constraints
  21. Foreign Keys
  22. Join Two Tables
  23. LEFT JOIN
  24. Join Three Tables
  25. Revenue per Product
  26. A Query Inside a Query
  27. CASE: Labels from Values
  28. Indexes
  29. Transactions
  30. Project: Monthly Sales Report
01SQL: Beyond the Basics11 lessons
  1. UNION: Two Queries, One Listfree
  2. Join a Table to Itselffree
  3. Dates: Months and Days Betweenfree
  4. Clean Up Textfree
  5. WITH: Name a Queryfree
  6. One CTE on Top of Anotherfree
  7. Number the Rows: ROW_NUMBERfree
  8. A Ranking per Group: PARTITION BYfree
  9. Top 2 per Categoryfree
  10. Running Totalsfree
  11. Compare with the Row Before: LAGfree
02SQL: Designing Tables5 lessons
  1. Many to Many: A Table in the Middle
  2. Rules in the Table: CHECK and UNIQUE
  3. Don't Store It Twice
  4. Views: A Saved Query
  5. Read a Query Plan
03SQL: Indexes5 lessons
  1. An Index on Two Columns
  2. A Covering Index
  3. An Index That Sorts
  4. Unique and Partial Indexes
  5. Why Is This Query Still Slow?
04SQL: Interview Questions28 lessons
  1. Second-Highest Price
  2. Find Duplicate Emails
  3. Customers Who Never Ordered
  4. Top Customer of Each Month
  5. Percent of Total
  6. Pivot Rows into Columns
  7. Find the Missing Ids
  8. Days in a Row
  9. Customers Who Spend More Than Average
  10. Each Customer's First Order
  11. Customers Who Came Back
  12. Month over Month
  13. The Products Behind 80% of Revenue
  14. The Median Price
  15. Delete Duplicates, Keep One
  16. Employees Who Earn More Than Their Manager
  17. Highest Salary in Each Department
  18. Customers Who Bought Both
  19. Bought One but Not the Other
  20. Who Ordered Again Next Month
  21. A Moving Average
  22. Three in a Row
  23. Each Customer's Favorite Product
  24. Days Until the Second Order
  25. Cancellation Rate per Month
  26. Orders by Size
  27. New Customers per Month
  28. Walk a Hierarchy: WITH RECURSIVE
05NoSQL: MongoDB9 lessons
  1. Documents, Not Rows
  2. Find with Filters
  3. Reach Inside: Nested Fields and Lists
  4. Change Documents
  5. The Aggregation Pipeline
  6. One Row per Item: $unwind
  7. Embed or Reference?
  8. Indexes and Unique Fields
  9. An Index on Two Fields
06NoSQL: Redis6 lessons
  1. Keys and Values
  2. Keys That Expire
  3. Hashes: A Small Record
  4. Lists as a Queue
  5. Sorted Sets: A Leaderboard
  6. Cache a Slow Answer
07NoSQL: Choosing a Database2 lessons
  1. One Question, Three Stores
  2. Which One Fits?

Questions

Something else?
team@algocademy.com

Which SQL database is it?

SQLite. Your queries run on a small shop database with customers, products and orders.

Do I need Python?

Barely. Each SQL lesson is a short Python script that is already written. You type the query, one clause per step. The MongoDB and Redis lessons use Python dictionaries and lists.

Are MongoDB and Redis real?

You use the real client libraries, pymongo and redis-py. In the lessons they talk to in-memory stand-ins that take the same commands, so the same code runs on a real server.

More in Data & AIAI EngineeringMachine LearningData EngineeringAll courses

LESSON 1

UNION: Two Queries, One List

The first chapter is free, no card needed. The rest comes with PRO.