Skip to main content
table of contents
Querying from multiple tables
When data spans multiple tables, you need to be able to combine (or join) tables. The logic for this comes from set theory.
| A $\cap$ B | A $\cup$ B
Exercise: Joining data to make a query
Consider an example where two tables exist in a database. A superhero table collects information about the superhero names and date of birth. A powers table collects information about each individual's superpower information.
Let's say we want to query for all humans
who are at least of drinking age
(born before 12/31/1990). We would have to join both tables into one temporary big table before applying filter conditions.