Knowledge

JOIN

Subject: .../SQL
SQL operation that allows to link two different sources of data. Most common joins are INNER (1 to 1) are LEFT OUTER (1 to Many)

Materials

  • Join_(SQL)
    An SQL join clause - corresponding to a join operation in relational algebra - combines columns from one or more tables in a relational database. It creates a set that can be saved as a table or used as it is. A JOIN is a means for combining columns from one (self-join) or more tables by using values common to each. ANSI-standard SQL specifies five types of JOIN: INNER, LEFT OUTER, RIGHT OUTER, FULL OUTER and CROSS. As a special case, a table (base table, view, or joined table) can JOIN to itself in a self-join.
Check yourself
Q:

What is the right type of join when you want to have all possible combinations of rows from two tables?

Q:

What happens during INNER join when right table contains two matching records (A and B) for some row (X) in left table?

Do you know that ...?
- Cross join - all combinations of rows in left table and right table

If left table contains N rows and right table contains M rows, cross join will result in N*M rows

- Left join get all rows from main (left) table, and whatever matched from right table

If no match found in the right table, the coresponding columns will contain NULL

Skillsets
Skillset Web Backend Developer preview
image descriptionWeb Backend Developer
by Infinite Education
2092 users
Skillset PHP Developer preview
image descriptionPHP Developer
by Infinite Education
2566 users
Skillset PostgreSQL DBA preview
image descriptionPostgreSQL DBA
by Artem Naumenko (fb)
1630 users
Skillset PHP Dev preview
image descriptionPHP Dev
by Tam NGuyễn
3 users
Skillset PHP new preview
image descriptionPHP new
by Nuriddin Rashidov
1 users
Skillset Skyeng PostgreSQL DBA preview
image descriptionSkyeng PostgreSQL DBA
by Artem Naumenko (slack2)
Skillset PHP Developer Roadmap preview
image descriptionPHP Developer Roadmap
by goncalves.helder