T-SQL入門攻略之创建数据表:使用主键约束 主键不允许重复也不允许有空值 --1单字段主键 IF OBJECT_ID ('testtable', 'U') IS NOT NULL DROP TABLE testtable; CREATE TABLE testtable ( col1 varchar(10), col2 int, col3 datetime, co
alter table BOOK add constraint PK_BOOK primary key BOOK_IDalter table AUTHOR add constraint PK_AUTHOR primary key BOOK_IDinsert into book values('1203','数据库系统与应用教程',32.8)update BOOK set PRICR=PRICR * 0.75 where BOOK_ID='1013'delete from AUTHOR where AUTHOR_NAME ...