create table in mysqlw code example
Example 1: create table in mysql
CREATE TABLE user (
userId INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(100),
password VARCHAR(100)
) ENGINE=InnoDB;
Example 2: create table mysql
CREATE TABLE IF NOT EXISTS tasks (
task_id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
start_date DATE,
due_date DATE,
status TINYINT NOT NULL,
priority TINYINT NOT NULL,
description TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=INNODB;
Example 3: create table in mysql
CREATE TABLE user (
userId INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(100),
password VARCHAR(100)
) ENGINE=InnoDB;
Example 4: how to create a table in mysql
CREATE TABLE `test_table`
(
id INT(10) PRIMARY KEY,
username VARCHAR(50) NOT NULL
);