Skip to main content

Databases: Joins

Databases
Joins
    • Notifications
    • Privacy
  • Project HomeTools and Techniques in Software Engineering
  • Projects
  • Learn more about Manifold

Notes

Show the following:

  • Annotations
  • Resources
Search within:

Adjust appearance:

  • font
    Font style
  • color scheme
  • Margins
table of contents
  1. Introduction to Databases
  2. Relational Model
  3. Organizing Information
  4. Querying
    1. Example with SQLite
    2. Example with Google Sheet Query
  5. Joins
  6. Products
  7. Bibliography

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

Join Logic

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.

Database Schema

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.

Database query

Annotate

Next Chapter
Products
PreviousNext
Powered by Manifold Scholarship. Learn more at
Opens in new tab or windowmanifoldapp.org