“Buat tabel mysql” Kode Jawaban

Buat tabel 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;
Nathan Stanford

Buat tabel kueri mysql

create table tutorials_tbl(
   tutorial_id INT NOT NULL AUTO_INCREMENT,
   tutorial_title VARCHAR(100) NOT NULL,
   tutorial_author VARCHAR(40) NOT NULL,
   submission_date DATE,
   PRIMARY KEY ( tutorial_id )
);
Thankful Tamarin

Buat tabel di mysql

CREATE TABLE users(
id INT AUTO_INCREMENT,
   first_name VARCHAR(100),
   last_name VARCHAR(100),
   email VARCHAR(50),
   password VARCHAR(20),
   location VARCHAR(100),
   dept VARCHAR(100),
   is_admin TINYINT(1),
   register_date DATETIME,
   PRIMARY KEY(id)
);
Gaurav Gupta

Buat tabel mysql

CREATE TABLE IF NOT EXISTS `sys_user_details` (
    user_detail_id INT(11) AUTO_INCREMENT,
    user_id INT(11),
    name VARCHAR(100) NOT NULL,
    email VARCHAR(200) NOT NULL,
    education VARCHAR(100) DEFAULT NULL,
    skills VARCHAR(100) DEFAULT NULL,
    experience VARCHAR(100) DEFAULT NULL,
    CONSTRAINT PK_sys_user_details PRIMARY KEY (user_detail_id),
    CONSTRAINT FK_sys_user_details_user_id FOREIGN KEY (user_id)
    REFERENCES sys_user(user_id)
        ON UPDATE RESTRICT ON DELETE CASCADE
);
Successful Swiftlet

Membuat tabel di mysql

#Assuming that there is a database called MyDatabase
#creates a table called TableName, with columns Name, Age, and Class
Use MyDatabase;
create table TableName(
  No. int primary key,
  Name varchar(50),
  Age int,
  Class varchar(15));
VinCoD

Buat kueri tabel di mysql

//Create database table mysql
// Note for id always set it to auto-increment (AI)
 CREATE TABLE `database_name`.`new_table_name` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `first_name` VARCHAR(45) NOT NULL,
  `last_name` VARCHAR(45) NOT NULL,
  `title` VARCHAR(45) NOT NULL,
  PRIMARY KEY (`id`, `first_name`, `last_name`, `title`));
Omo Junior

Jawaban yang mirip dengan “Buat tabel mysql”

Pertanyaan yang mirip dengan “Buat tabel mysql”

Lebih banyak jawaban terkait untuk “Buat tabel mysql” di Sql

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya