【正文】
imary key,StorageNumber varchar(50) not null,carName varchar(50) not null,price int not null,status varchar(50) not null,foreign key(StorageNumber) references 倉(cāng)庫(kù)信息表(StorageNumber))。create table 倉(cāng)庫(kù)信息表(StorageNumber varchar(50) primary key,StockNumber int not null,DeliverNumber int not null,ReserveNumber int not null,)。阿大39。0139。11139。insert into 車(chē)輛信息表Values(‘911’,’010’,’保時(shí)捷’,’254’,’現(xiàn)車(chē)’)。insert into 倉(cāng)庫(kù)信息表Values(‘010’,’10’,’5’,’5’)。 索引的建立create clustered index IX_id on 顧客信息表(id); create unique index IX carID on 車(chē)輛信息表(carID)。存儲(chǔ)過(guò)程的建立(選作內(nèi)容)根據(jù)應(yīng)用要求,至少設(shè)計(jì)一個(gè)存儲(chǔ)過(guò)程,寫(xiě)出SQL語(yǔ)句。sp_addlogin 39。,39。為登錄帳戶(hù),設(shè)計(jì)創(chuàng)建一個(gè)數(shù)據(jù)庫(kù)用戶(hù),寫(xiě)出相應(yīng)的SQL語(yǔ)句。ABC39。ABC39。sp_addrolemember 39。,39。 UNIQUE約束alter table 顧客信息表add constraint unique_idunique nonclustered(id)CHECK約束alter table 車(chē)輛信息表add constraint check_pricecheck(price=2000) DEFAULT約束(1)create default M as 39。(2)sp_bindefault M,39。NOT NULL約束create table 倉(cāng)庫(kù)信息管理表 (StorageNumber varchar(50) primary key,StockNumber int not null,DeliverNumber int unique not null)。39。第六章 運(yùn)行與結(jié)果簡(jiǎn)單查詢(xún) select carID,StorageNumber,carName,price from 車(chē)輛信息表 where carName=39。select id,ClientName,age,sex from 顧客信息表 where age=39。連接查詢(xún)查詢(xún)性別為男的顧客姓名,年齡,電話 select clientName,age,telephoneNumber from 顧客信息表 where sex=’男’。查詢(xún)訂單號(hào)為1238的汽車(chē)價(jià)格,車(chē)輛名稱(chēng)。123839。查詢(xún)訂單號(hào)為1235的汽車(chē)價(jià)格,車(chē)輛名稱(chēng)。123539。1)統(tǒng)計(jì)價(jià)格大于300的車(chē)名 select count(carName)車(chē)名 from 車(chē)輛信息表 Where price300。