Friday, February 7, 2020

Setting Default Values

CODE: Setting Default Values 

Define a table with a DEFAULT name specified:
Notice the change when you describe the table:
DESC cats3; 
Insert a cat without a name:
INSERT INTO cats3(age) VALUES(13); 
Or a nameless, ageless cat:
INSERT INTO cats3() VALUES(); 
Combine NOT NULL and DEFAULT:
  
Notice The Difference:

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