以下内容,是做牛客网数据库SQL实战过程中涉及到的sql知识点。
感兴趣可以去做一下:https://www.nowcoder.com/ta/sql
表table
创建表 create
create table actor(
actor_id SMALLINT(5) not null primary key,
first_name varchar(45) not null,
last_name varchar(45) not null,
last_update timestamp not null default(now())
);
插入一列 alter add
alter table actor add
create_date datetime not null default ‘0000-00-00 00:00:00’;
修改表名 alter rename
Alter table titles_test rename to titles_2017;
Rename table titles_test to titles_2017;
插入记录 insert into
insert into actor values
(1, ‘PENELOPE’, ‘GUINESS’, ‘2006-02-15 12:34:33’),
(2, ‘NICK’, ‘WAHLBERG’, ‘2006-02-15 12:34:33’),
(3, ‘ED’, ‘CHASE’, ‘2006-02-15 12: