How to create an INSERT statement.
mysql>
mysql> CREATE TABLE CDs
-> (
-> CDID SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> CDName VARCHAR(50) NOT NULL,
-> Copyright YEAR,
-> NumberDisks TINYINT UNSIGNED NOT NULL DEFAULT 1,
-> NumberInStock TINYINT UNSIGNED,
-> NumberOnReserve TINYINT UNSIGNED NOT NULL,
-> NumberAvailable TINYINT UNSIGNED NOT NULL,
-> CDType VARCHAR(20),
-> RowAdded TIMESTAMP
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO CDs
-> VALUES (NULL, 'Notebook: The Steve Earle Collection',
-> 1996, 2, 10, 3, NumberInStock-NumberOnReserve, 'Country', NULL);
Query OK, 1 row affected (0.00 sec)
mysql>
mysql>
mysql> drop table CDs;
Query OK, 0 rows affected (0.00 sec)
Related examples in the same category