- 两个人同时犯了错, 站出来承担的那一方叫宽容, 另一方欠下的债, 早晚都要还。- 不爱就不爱, 别他妈的说我们合不来。 7-2 alter table BookInfo alter column b_Name varchar(50)not null 7-4 create table BookInfo ( b_ID varchar(16)NOT NULL, b_Name varchar(50)NOT NULL, bt_ID char(10)not null, b_Author varchar(20)not null, b_Translator varchar(20)NULL, b_ISBN varchar(30) NOT NULL, p_ID char(4)NOT NULL, b_Date datetime NOT NULL, b_Edition smallint NOT NULL default 1, b_Price money NOT NULL, b_Quantity smallint NOT NULL, b_Detail varchar(100) NULL default' 暂无描述', b_Picture image NULL ) insert into BookInfo(b_ID,b_Name,bt_ID,b_Author,b_Translator,b_ISBN,p_ID,b_Date,b_Price,b_Qu antity) values('TP3/2999',' 测 试默认值','17',' 默 认值',' 无','7-03-015754-0','007','2009-4-1',,14) select*from BookInfo where b_Name=' 测试默认值' 7-6 alter table BookInfo with nocheck add constraint ck_Quantity check(b_Quantity>=1 and b_Quantity<=100) 7-8 create table BookInfo ( b_ID varchar(16)primary key, b_Name varchar(50)NOT NULL, bt_ID char(10)not null, b_Author varchar(20)not null, b_Translator varchar(20)NULL, b_ISBN varchar(30) NOT NULL, p_ID char(4)NOT NULL, b_Date datetime NOT NULL, b_Edition smallint NOT NULL default 1, b_Price money NOT NULL, b_Quantity smallint NOT NULL, b_Detail varchar(100) NULL default' 暂无描述', b_Picture image NULL ) create table BorrowReturn (--br_ID char(6) NOT NULL, -- 借阅编号 s_ID char(8) NOT NULL, -- 条型码 r_ID char(8) NOT NULL, -- 借
数据库例题 来自淘豆网m.daumloan.com转载请标明出处.