1# Creates a Simple User table
2# Uses an auto-incrementing primary key as userId
3
4CREATE TABLE user (
5 userId INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
6 username VARCHAR(100),
7 password VARCHAR(100)
8) ENGINE=InnoDB;
1CREATE TABLE IF NOT EXISTS tasks (
2 task_id INT AUTO_INCREMENT PRIMARY KEY,
3 title VARCHAR(255) NOT NULL,
4 start_date DATE,
5 due_date DATE,
6 status TINYINT NOT NULL,
7 priority TINYINT NOT NULL,
8 description TEXT,
9 created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
10) ENGINE=INNODB;
11
1create table tutorials_tbl(
2 tutorial_id INT NOT NULL AUTO_INCREMENT,
3 tutorial_title VARCHAR(100) NOT NULL,
4 tutorial_author VARCHAR(40) NOT NULL,
5 submission_date DATE,
6 PRIMARY KEY ( tutorial_id )
7);
8
1# updated dec 2020
2# Creates a Simple User table
3# Uses an auto-incrementing primary key as userId
4
5CREATE TABLE user (
6 userId INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
7 username VARCHAR(100),
8 password VARCHAR(100)
9) ENGINE=InnoDB;
1create table tutorials_tbl(
2 tutorial_id INT NOT NULL AUTO_INCREMENT,
3 tutorial_title VARCHAR(100) NOT NULL,
4 tutorial_author VARCHAR(40) NOT NULL,
5 submission_date DATE,
6 PRIMARY KEY ( tutorial_id )
7);
1-- 'CREATE TABLE' followed by the name of the table.
2-- In round brackets, define the columns.
3CREATE TABLE `test_table`
4(
5 id INT(10) PRIMARY KEY,
6 username VARCHAR(50) NOT NULL
7);