Docsity

Joining Tables in SQL: INNER JOIN, LEFT JOIN, and RIGHT JOIN, Apuntes de Informática

Toggle sidebar
bg1
INNER JOIN, LEFT JOIN, and RIGHT JOIN
In this opportunity we will define, compare and contrast the INNER JOIN, LEFT JOIN, and RIGHT JOIN
commands.
First we must understand the use of the INNER JOIN command, which is used to join 2 tables using a
common attribute. Graphically it would look like this:
The biggest advantage we find using this command is that thanks to the common attribute we will be
able to join all the values that both tables have in common (SQL INNER JOIN keyword, n.d.).
Secondly, we have the LEFT JOIN command, which works as follows:
Thanks to this graphic we understand that this command takes all the records from the left table while it
only takes those records within the left table that are also in the right table (SQL LEFT JOIN
keyword, n.d.). understanding this command, the RIGHT JOIN works in the same way only that in this
case it would take the right table first (SQL RIGHT JOIN keyword, n.d.):
Thirdly, among the differences we find in these commands is that only INNER JOIN takes values that are
in both tables, while the others are going to take certain values partially.
It should also be noted that there are commands that can modify the initial result, such as FULL JOIN
(SQL joins, n.d.).
pf2

Vista previa parcial del texto

¡Descarga Joining Tables in SQL: INNER JOIN, LEFT JOIN, and RIGHT JOIN y más Apuntes en PDF de Informática solo en Docsity!

INNER JOIN, LEFT JOIN, and RIGHT JOIN In this opportunity we will define, compare and contrast the INNER JOIN, LEFT JOIN, and RIGHT JOIN commands. First we must understand the use of the INNER JOIN command, which is used to join 2 tables using a common attribute. Graphically it would look like this: The biggest advantage we find using this command is that thanks to the common attribute we will be able to join all the values that both tables have in common ( SQL INNER JOIN keyword , n.d.). Secondly, we have the LEFT JOIN command, which works as follows: Thanks to this graphic we understand that this command takes all the records from the left table while it only takes those records within the left table that are also in the right table ( SQL LEFT JOIN keyword , n.d.). understanding this command, the RIGHT JOIN works in the same way only that in this case it would take the right table first ( SQL RIGHT JOIN keyword , n.d.): Thirdly, among the differences we find in these commands is that only INNER JOIN takes values that are in both tables, while the others are going to take certain values partially. It should also be noted that there are commands that can modify the initial result, such as FULL JOIN ( SQL joins , n.d.).

Bibliography SQL INNER JOIN keyword. (n.d.). W3schools.Com. Retrieved June 19, 2022, from https://www.w3schools.com/sql/sql_join_inner.asp SQL joins. (n.d.). W3schools.Com. Retrieved June 19, 2022, from https://www.w3schools.com/sql/sql_join.asp SQL LEFT JOIN keyword. (n.d.). W3schools.Com. Retrieved June 19, 2022, from https://www.w3schools.com/sql/sql_join_left.asp SQL RIGHT JOIN keyword. (n.d.). W3schools.Com. Retrieved June 19, 2022, from https://www.w3schools.com/sql/sql_join_right.asp