inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지

컬럼의 옵션들

create table 복사용

257

김세준
0

create schema nodejs;

use nodejs;

 

create table nodejs.users(

id INT NOT NULL auto_increment,

    name varchar(20) not null,

    age int unsigned not null,

    married tinyint not null,

    comment text null,

    created_at DATETIME not null default now(),

    primary key(id),

    unique index name_unique (name ASC))

    comment = '사용자 정보'

    default character set = utf8

    engine = InnoDB;

    

create table comments(

id int not null auto_increment,

    commenter int not null,

    comment varchar(100) not null,

    created_at datetime not null default now(),

    primary key(id),

    index comment_idx(commenter asc),

    constraint commenter

    foreign key (commenter)

    references nodejs.users (id)

    on delete cascade

    on update cascade)

    comment = '댓글'

    default charset = utf8mb4

    engine = InnoDB;

 

 

파워포인트는 그림 캡쳐라서 복사용 게시물 남깁니다

답변 0