1/7
Flashcards covering the types of joins, their syntax, and usage in MySQL.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Inner Join
Returns rows where the same data appears in both tables being joined.
Outer Join
Selects all data from one table and only matching data from a second table, showing null values for non-matching data.
Left Outer Join
Returns all rows from the first table (left table) and matching rows from the second table (right table). Non-matching rows from the right table will have null values.
Right Outer Join
Returns all rows from the second table (right table) and matching rows from the first table (left table). Non-matching rows from the left table will have null values.
ON clause in JOIN
Specifies the condition on which the tables are joined, indicating which columns will be matched across the tables. Critical for accurate results.
Synonyms for Inner Join in MySQL
join, inner join, and cross join.
Foreign Key
A column in one table that refers to the primary key of another table, enforcing data integrity and consistency between tables.
Why Explicitly Label Table Column?
It is best practice to explicitly label which table a column comes from when joining multiple tables. This is technically only required if two tables being joined have columns with the same name, but it is always good practice.