Monday, March 2, 2020

Right Joins

-- OUR FIRST RIGHT JOIN (seems the same as a left join?)
SELECT * FROM customers
RIGHT JOIN orders
    ON customers.id = orders.customer_id;
-- ALTERING OUR SCHEMA to allow for a better example (optional)
-- INSERTING NEW DATA (no longer bound by foreign key constraint)

No comments:

Post a Comment

Right Joins

-- OUR FIRST RIGHT JOIN (seems the same as a left join?) SELECT * FROM customers RIGHT JOIN orders     ON customers.id = orders.custom...