Oct 16, 2024
INSERT INTO products VALUES (104, 'Straw', 0.00);
INSERT INTO products VALUES (105, 'Napkin', 0.00);
CREATE TABLE products (
product_id INT,
product_name VARCHAR(25),
price DECIMAL(4,2) DEFAULT 0.00
);
ALTER TABLE products ALTER COLUMN price SET DEFAULT 0.00;
INSERT INTO products (product_id, product_name) VALUES (104, 'Straw');
TransactionId
- integer.Amount
- decimal(5,2).TransactionDate
- datetime (defaulting to current time).CREATE TABLE transactions (
transaction_id INT,
amount DECIMAL(5,2),
transaction_date DATETIME DEFAULT NOW()
);
INSERT INTO transactions (transaction_id, amount) VALUES (1, 4.99);