Friday, February 7, 2020

Primary Keys

CODE: Primary Keys

Define a table with a PRIMARY KEY constraint:
DESC unique_cats; 
Insert some new cats:
Notice what happens:
SELECT * FROM unique_cats; 
Adding in AUTO_INCREMENT:
INSERT a couple new cats:
Notice the difference:
SELECT * FROM unique_cats2;

//

Table Constraints Exercise Solution

Defining The employees table:
Another way of defining a primary key:

A test INSERT:

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...