Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
MySQL: DEFAULT constraint is easy
Play lesson

MySQL tutorial for beginners 🐬 - MySQL: DEFAULT constraint is easy

4.0 (1)
11 learners

What you'll learn

This course includes

  • 2.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

#MySQL #course #tutorial 00:00:00 intro 00:02:25 DEFAULT when creating a table 00:03:26 DEFAULT for an existing table 00:05:19 example 2 00:07:56 conclusion – EXAMPLE 1 CREATE TABLE products ( product_id INT, product_name varchar(25), price DECIMAL(4, 2) DEFAULT 0 ); ALTER TABLE products ALTER price SET DEFAULT 0; INSERT INTO products (product_id, product_name) VALUES (104, "straw"), (105, "napkin"), (106, "fork"), (107, "spoon"); SELECT * FROM products; – EXAMPLE 2 CREATE TABLE transactions( transaction_id INT, amount DECIMAL(5, 2), transaction_date DATETIME DEFAULT NOW() ); SELECT * FROM transactions; INSERT INTO transactions (transaction_id, amount) VALUES (1, 4.99); SELECT * FROM transactions; INSERT INTO transactions (transaction_id, amount) VALUES (2, 2.89); SELECT * FROM transactions; INSERT INTO transactions (transaction_id, amount) VALUES (3, 8.37); SELECT * FROM transactions; DROP TABLE transactions;

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere