Back to Topic 3.3 — Database programming
3.3.2Computer Science SL5 flashcards

Joining two tables

Practice Flashcards

Flip to reveal answers
Card 1 of 53.3.2
3.3.2
Question

What does the ON condition in a JOIN do?

Click to reveal answer

Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.

All 5 Flashcards — Joining two tables

Sign up free to track progress and get spaced-repetition review schedules.

Card 1definition

Question

What does the ON condition in a JOIN do?

Answer

It names the two columns that must match — almost always a foreign key and the primary key it points at. Without it, every row of one table pairs with every row of the other.

Card 2process

Question

In what order are SQL clauses applied?

Answer

FROM and JOIN decide which rows exist, WHERE filters them, GROUP BY collapses them, HAVING filters the groups, SELECT picks the columns, and ORDER BY sorts. SELECT is written first but applied near the end.

Card 3comparison

Question

What is the difference between WHERE and HAVING?

Answer

WHERE filters individual rows before grouping. HAVING filters groups after grouping, and is the only place a condition on a count or total can go, because that value does not exist until GROUP BY has run.

Card 4definition

Question

How does LIKE with the % wildcard work?

Answer

% stands for any run of characters. 'Sm%' matches anything starting Sm, '%son' anything ending son, and '%ann%' anything containing ann.

Card 5concept

Question

When is DISTINCT needed in a joined query?

Answer

When the join can legitimately produce the same row more than once — a student belonging to two clubs would otherwise appear twice in a list of names.

Track your progress with spaced repetition

Sign up free — Aimnova tells you exactly which cards to review and when, so you remember everything before your IB exam.

Start Free
IB Computer Science Joining two tables Flashcards | 3.3.2 | Aimnova