DATABASE
beginner
Relational Algebra & Joins
Software Engineer path · lesson 50 of 99Visualize the mathematical foundations of SQL: Projections, Selections, and different types of Joins.
Table ATable B
Match
| Users (A) | |
|---|---|
| ID | Name |
| 1 | Alice |
| 2 | Bob |
| 3 | Eve |
| Orders (B) | |
|---|---|
| U_ID | Item |
| 1 | Pen |
| 2 | Mug |
| 9 | Hat |
| Result | ||
|---|---|---|
| ID | Name | Item |
| 1 | Alice | Pen |
| 2 | Bob | Mug |
σ, π or ⋈?
Sort
Sort each description into the relational operator it describes.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
σ Selection
Drop items hereπ Projection
Drop items here⋈ Join
Drop items here6 pieces left to place
Test your knowledge
21 questions
Question 1 of 21
Score: 0
If Table A has 5 rows and Table B has 4 rows, and you perform a CROSS JOIN (Cartesian Product), how many rows will be in the result set?
The short version
Relational Algebra is the blueprint for SQL. Projection is slicing a spreadsheet vertically (keeping only some columns). Selection is slicing it horizontally (keeping only some rows). A Join is stitching two spreadsheets together based on matching IDs.
In more depth
Relational Algebra
The theoretical foundation that powers all relational databases.
Core Operations
Selection (σ): Filters rows that meet a condition (SQL
WHERE).Projection (π): Selects specific columns (SQL
SELECT col1, col2).Join (⋈): Combines rows from two tables based on a related column.
Join Types
Inner Join: Returns only rows with a match in both tables.
Left Join: Returns all rows from the left table, and matching rows from the right (or NULLs).
Interview Questions
Amazon
Microsoft
Google
Amazon
Microsoft
Meta
Netflix
Uber
References & Further Reading
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required