Combining Tables (SQL) Flashcards

1
Q

Union

A

Combines one table to the bottom of another table. Ensure that the columns are in the same order for both tables.
https://dataschool.com/how-to-teach-people-sql/sql-join-types-explained-visually/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Inner Join

A

Place one table ‘next’ to another with values matched by a common dimension.
Remove all rows where the joining dimension’s do not exist in either table.
https://dataschool.com/how-to-teach-people-sql/sql-join-types-explained-visually/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Left Join

A

Place one table ‘next’ to another with values matched by a common dimension.
Remove all rows where the joining dimension’s do not exist in the table to the LEFT of the join statement. Use NULLs for values in the table to the right of the join, if there is no match.
https://dataschool.com/how-to-teach-people-sql/sql-join-types-explained-visually/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Right Join

A

Place one table ‘next’ to another with values matched by a common dimension.
Remove all rows where the joining dimension’s do not exist in the table to the RIGHT of the join statement. Use NULLs for values in the table to the left of the join, if there is no match.
https://dataschool.com/how-to-teach-people-sql/sql-join-types-explained-visually/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Full (outer) Join

A

Place one table ‘next’ to another with values matched by a common dimension.
Use NULLs for values in either table if there is no match.
https://dataschool.com/how-to-teach-people-sql/sql-join-types-explained-visually/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Cross (Cartesian) Join

A

Combine every combination of the two tables values; where the number of total rows equal to the number of rows in table 1 multiplied by the number of rows in table 2.
https://dataschool.com/how-to-teach-people-sql/sql-join-types-explained-visually/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly