forked from HackYourFuture/databases
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.sql
More file actions
21 lines (15 loc) · 615 Bytes
/
Copy pathdb.sql
File metadata and controls
21 lines (15 loc) · 615 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
CREATE DATABASE IF NOT EXISTS 'todo'
CREATE TABLE IF NOT EXISTS `tasks` (
`id` int(11) NOT NULL,
`task` varchar(200) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `tasks` ADD PRIMARY KEY (`id`);
ALTER TABLE `tasks` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
/*sample data*/
INSERT INTO `tasks` (`id`, `task`,`created_at`) VALUES
(1, 'Shopping','2016-04-10 23:50:40'),
(2, 'Homework','2016-04-10 23:50:40'),
(3, 'Cleaning', '2016-04-10 23:50:40'),
(4, 'Sleeping', '2016-04-10 23:50:40'),
(5, 'Vacuuming','2016-04-10 23:50:50');