SQL 知识纲要

database

table, view, function, procedure

table

record, field, index

record

insert
update
delete
select: top, distinct, order, group

where

and/or, in, between, is null, is not null, like

field

type: int, text, date, blob

constraints: not null, default, unique, auto_increment, primary key, foreign key, check;

alter table

add unique(xxx)

add primary key(xxx)

drop primary key

add foreign key(xxx) references table_name(xxx)

drop foreign key

add check(xxx)

alter field_name set default val

alter field_name drop default

add column xxx type

drop column xxx

 

原文地址:https://www.cnblogs.com/weichsel/p/2458585.html