· 6 years ago · Aug 07, 2019, 04:06 AM
1CREATE TABLE IF NOT EXISTS `products` (
2 `p_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
3 `p_name` varchar(128) NOT NULL,
4 `p_description` text NOT NULL,
5 `p_price` double NOT NULL,
6 `p_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
7 `p_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
8);
9
10INSERT INTO `products` (`p_id`, `p_name`, `p_description`, `p_price`) VALUES
11 (1, 'Basketball', 'A ball used in the NBA.', 49.99),
12 (3, 'Gatorade', 'This is a very good drink for athletes.', 1.99),
13 (4, 'Eye Glasses', 'It will make you read better.', 6),
14 (5, 'Trash Can', 'It will help you maintain cleanliness.', 3.95),
15 (6, 'Mouse', 'Very useful if you love your computer.', 11.35),
16 (7, 'Earphone', 'You need this one if you love music.', 7),
17 (8, 'Pillow', 'Sleeping well is important.', 8.99);