1. Referencing 2 tables (effects with inner join)
1 SELECT from WHERE =
2.INNER Join Join (returns a row if there is at least one match in the table)
1 SELECT from INNER JOIN on = ORDER by Persons.lastname
3.LEFT join: Even if there is no match in the right table, all rows are returned from the left table (all people one and their subscription, even if not ordered, will return) (the left JOIN keyword returns all rows from the table (Persons), even if the right table (Orders) There are no matching rows in the. )
1 SELECT Persons.lastname, Persons.firstname, Orders.orderno 2 from Persons 3 Left JOIN Orders 4 on Persons.id_p=orders.id_p5ORDER by Persons.lastname
4.RIGHT join: All rows are returned from the right table, even if there is no match in the left table (the right JOIN keyword returns all rows from that table (Orders), even if there are no matching rows in the left table (Persons). )
1 SELECT Persons.lastname, Persons.firstname, Orders.orderno 2 from Persons 3 Right JOIN Orders 4 on Persons.id_p=orders.id_p5ORDER by Persons.lastname
5.FULL JOIN: Returns a row whenever there is a match in one of the tables (the full JOIN keyword returns all rows from the left table (Persons) and the right table (Orders). If the rows in "Persons" do not match in the table "orders", or if the rows in "orders" do not have a match in the table "Persons", the rows are also listed. )
1 SELECT Persons.lastname, Persons.firstname, Orders.orderno 2 from Persons 3 Full JOIN Orders 4 on Persons.id_p=orders.id_p5ORDER by Persons.lastname
SQL JOIN INNER left right full