题解 | 创建表格

创建一个actor表,包含如下列信息

http://www.nowcoder.com/practice/ac233de508ef4849b0eeb4f38dcf09cf

  • 创建表格 create table xxx()
  • primary key 单独写
  • 外键写法:
  • FOREIGN KEY (Id_P) REFERENCES Persons(Id_P)
    
CREATE table actor (
actor_id smallint(5),
first_name varchar(45) not null,
last_name varchar(45) not null,
last_update date not null,
PRIMARY KEY (actor_id));
一个确认不会重复建表的操作
drop table if exists actor;

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务