Module 4: MySQL Joins and Set Operations

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/6

flashcard set

Earn XP

Description and Tags

MySQL Joins and Set Operations

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

7 Terms

1
New cards

JOIN clause

is used to combine rows from two or more tables, based on a related column between them.

2
New cards

INNER JOIN

Returns records that have matching values in both tables

3
New cards

LEFT JOIN

Returns all records from the left table, and the matched records from the right table

4
New cards

RIGHT JOIN

Returns all records from the right table, and the matched records from the left table

5
New cards

CROSS JOIN

Returns all records from both tables

6
New cards

UNION operator

is used to combine the result-set of two or more SELECT statements.

  • Every SELECT statement within UNION must have the same number of columns

  • The columns must also have similar data types

  • The columns in every SELECT statement must also be in the same order

7
New cards

UNION Syntax

SELECT column_name(s) FROM table1 UNION column_name(s) FROM table2;

  • The UNION operator selects only distinct values by default. To allow duplicate values, use UNION ALL:

SELECT column_name(s) FROM table1 UNION ALL column_name(s) FROM table2;