MySQL: MySQL CREATE TABLE with AUTO_INCREMENT #11
Ready — edit the code above and click Run.
CREATE TABLE orders (
id INT AUTO_INCREMENT PRIMARY KEY,
customer_id INT NOT NULL,
amount DECIMAL(12,2) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT fk_customer FOREIGN KEY (customer_id) REFERENCES customers(id)
) ENGINE=InnoDB;
Try solving on your own first, then reveal the official answer.
MySQL-specific syntax: LIMIT, AUTO_INCREMENT, ENGINE=InnoDB, DELIMITER for procedures.