Draymonders / Code-Life

The marathon continues though.
27 stars 3 forks source link

基础 sql #14

Closed Draymonders closed 3 years ago

Draymonders commented 4 years ago

感觉自己sql也是个渣渣

https://www.freecodecamp.org/news/common-sql-interview-questions/

刷题链接 https://www.nowcoder.com/ta/sql?query=&asc=true&order=&page=1

Draymonders commented 4 years ago

关于主键设置

单主键情况下

create table actor (
    actor_id smallint(5) not null primary key
);

多主键情况

create table actor (
    actor_id smallint(5) not null,
    primary key (actor_id)
);