MySQL: NOT NULL constraint

73 Views
Published
#MySQL #course #tutorial

CREATE TABLE products (
product_id INT,
product_name varchar(25),
price DECIMAL(4, 2) NOT NULL
);

ALTER TABLE products
MODIFY price DECIMAL(4, 2) NOT NULL;

INSERT INTO products
VALUES(104, "cookie", NULL);
Category
Bro Code
Tags
MySQL tutorial, SQL tutorial, MySQL course
Be the first to comment