1/9
Sets
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Sets operation
are way to combine the results of two or more queries.
UNION
it combines results from two queries removes duplicates.
UNION ALL
it combines results from two queries keeps duplicates
Intersect
it returns only rows common to both queries
Inner Join
it returns only rows that have matching values in both tables.
Natural Join
Same as inner join, but SQL automatically joins on columns with the same name.
Left Join
it returns all rows from the left table (employees), plus matching rows from the right table. If no match, show NULL.
Right Join
it returns all rows from the right table (employees), plus matching rows from the left table. If no match, shows NULL.
Cross Join
it returns every combination of rows from both tables.
Views
use this when you want to save a query (with joins or subqueries) and reuse it later.