As it was mentioned in the previous lesson, there is also OUTER JOIN function (besides INNER JOIN function) During the previous lesson, we were trying to obtain a table containing all orders and the attached client information by means of INNER JOIN function This table contained only those clients, which have made orders in the currently existing store (because we have combined 'clients' and 'orders' tables, and the old orders are in 'old_orders' table) In order to obtain a table with all clients and attach their orders, we will have to use OUTER JOIN function. If 'clients' table must be situated on the left, then we should use LEFT OUTER JOIN (to take all elements from 'clients' and attach 'orders' table) LEFT OUTER JOIN: Returns all rows from the left table chained with rows from the right table (if there’s no coincidence with the condition, then a row with 'null' will be attached) Naturally, not all of the clients will have corresponding orders from 'orders' table, but since we use LEFT OUTER JOIN function, which outputs all elements from the left table, such clients will be shown in the resulting table, and there will be 'null' values over against them (in 'orders' part) FULL OUTER JOIN: Returns all rows from the left and the right tables shown as a single row in case of coincidence with the condition Press “Check my work” to continue.
Mission complete!
Press shift+enter to proceed
Use shift+up and shift+down to manage through queries history