1
2
3
4
5 CREATE TABLE IF NOT EXISTS checklists (
6 todo_id INT AUTO_INCREMENT,
7 task_id INT,
8 todo VARCHAR(255) NOT NULL,
9 is_completed BOOLEAN NOT NULL DEFAULT FALSE,
10 PRIMARY KEY (todo_id , task_id),
11 FOREIGN KEY (task_id)
12 REFERENCES tasks (task_id)
13 ON UPDATE RESTRICT ON DELETE CASCADE
14);Code language: SQL (Structured Query Language) (sql)
1CREATE TABLE [IF NOT EXISTS] tbl_name
2 (create_definition,...)
3 [table_options]
4 [partition_options]
5
1CREATE TABLE [IF NOT EXISTS] table_name(
2 column_1_definition,
3 column_2_definition,
4 ...,
5 table_constraints
6) ENGINE=storage_engine;