· 7 years ago · Sep 30, 2018, 05:38 PM
1
2CREATE DATABASE IF NOT EXISTS `tododb` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;
3USE `tododb`;
4
5create table if not exists todos
6(
7 `TodoID` INT NOT NULL AUTO_INCREMENT,
8 `Title` varchar(45) not null,
9 `Description` varchar(256) default '' null,
10 `Status` tinyint default 1 null,
11 PRIMARY KEY (`TodoID`)
12);
13
14INSERT INTO tododb.todos (TodoID, Title, Description, Status) VALUES (1, 'first ToDo in this DB', 'just try', 0);
15INSERT INTO tododb.todos (TodoID, Title, Description, Status) VALUES (2, 'second try', 'with changed status', 0);
16INSERT INTO tododb.todos (TodoID, Title, Description, Status) VALUES (3, 'one more try', 'with changed status', 0);
17INSERT INTO tododb.todos (TodoID, Title, Description, Status) VALUES (4, 'one more try', 'with changed status', 1);