27) 使用Enterprise Manager ,可以做以下任务中哪一个? A) 定义运行SQL Sever的服务器组。 B) 在每个已登记的服务器中创建和管理所有SQL Server数据库、对象、注册、和许可。 C) 在分布数据库环境中作为事务管理器。 D) 提供配置复制过程的对象和向导。[1分] 1. A, B, C 2. A, B, D 3. B, C, D 4. A, D, C
28)为存储产品的材料,你需创建Product表。该表应存储产品id、产品名字、价格、和现有的数量。第一个产品的产品id从1开始,以后的产品应自动加1。产品现有的数量应总是正的值。 为创建Product表,你应使用以下语句中哪个?[2分] 1.CREATE TABLE Product ( iProductId int IDENTITY(1,1), cProductName char(20) not null, iProductPrice int not null, iQuantity int not null constraint chkQty check(iQuantity <0) ) 2.CREATE TABLE Product ( iProductId int IDENTITY(1,1), cProductName char(20) not null, iProductPrice int not null, iQuantity int not null constraint chkQty check(iQuantity>0) ) 3.CREATE TABLE Product ( iProductId int not null constraint defProductId DEFAULT 1, cProductName char(20)not null, iProductPrice int not null, iQuantity int not null constraint chkQty check(iQuantity <0) ) 4.CREATE TABLE Product ( iProductId int not null constraint defProductId DEFAULT 1, cProductName char(20)not null, iProductPrice int not null, iQuantity int not null constraint chkQty check(iQuantity>0) )
29)为存储组织中不同部门的材料,创建以下Department表。 CREATE TABLE Department ( cDepartmentCode char(30) not null, vDepartmentName varchar(30) not null, vDepartmentHead varchar(25) not null, vLocation varchar(30) null )
37)为存储在联机礼品商店出售的不同礼物的材料,使用以下Gift表: CREATE TABLE Gift ( iGiftCode int not null, cGiftDescription char(10) not null, cSize char(40) not null, iWeight int not null, mPrice money not null )
创建一个过程,它接收礼品代码,如果该礼品出现在表中则返回0,否则返回1。过程创建如下: CREATE PROCEDURE prcGift @GiftCode int AS IF EXISTS (SELECT * FROM Gift WHERE iGiftCode = @GiftCode) BEGIN RETURN 0 END ELSE BEGIN RETURN 1 END
38)旅行社在以下的Resort表中存储了不同旅游胜地的材料。 CREATE TABLE Resort ( cResortCode char(50) not null, cResortName char(30) not null, cAddress char(50) not null, cCity char(30) not null, mPrice money null, mDiscount money null )
每个城市的打折是固定的。为更新某个城市的打折,创建了以下过程: CREATE PROCEDURE prcUpdateDiscount @City char(30), @Discount money AS IF EXISTS ( SELECT * FROM Resort WHERE cCity = @City) BEGIN UPDATE Resort SET mDiscount = @Discount WHERE cCity = @City RETURN 0 END ELSE BEGIN RETURN 1 END
3.DECLARE @ReturnValue int EXEC prcUpdateDiscount 'Houston',10, @ReturnValue OUTPUT SELECT @ReturnValue
4.DECLARE @ReturnValue int EXEC prcUpdateDiscount = @ReturnValue, 'Houston',10 SELECT @ReturnValue
39)按照关系理论,记录称为什么?[1分] 1.关系 2.元组 3.基数 4.度
40)联机花店把花的材料存储在以下的Flower表中: CREATE TABLE Flower ( cFlowerCode char(5) not null, cFlowerName char(30) not null, cFlowerDescription char(50) not null, mPrice money not null, mShippingCharges money not null, iWeight int not null ) 对于所有花要加上$1的运送费,直到平均运送费达到$8为止。但最大的运送费不应超过$10。 为加上运送费你将使用以下批处理中哪一个?[2分] 1.WHILE (SELECT AVG(mShippingCharges) FROM Flower) <8 BEGIN UPDATE Flower SET mShippingCharges = mShippingCharges + 1 IF (SELECT MAX(mShippingCharges) +1 FROM Flower)>10 BREAK ELSE CONTINUE END
2.WHILE (SELECT MAX(mShippingCharges) FROM Flower) <8 BEGIN UPDATE Flower SET mShippingCharges = mShippingCharges + 1 IF (SELECT AVG(mShippingCharges) +1 FROM Flower)>10 BREAK ELSE CONTINUE END 3.WHILE (SELECT AVG(mShippingCharges) FROM Flower) <8 BEGIN UPDATE Flower SET mShippingCharges = 1 IF (SELECT MAX(mShippingCharges) +1 FROM Flower)>10 BREAK ELSE CONTINUE END
4.WHILE (SELECT MAX(mShippingCharges) FROM Flower) <8 BEGIN UPDATE Flower SET mShippingCharges = 1 IF (SELECT AVG(mShippingCharges) +1 FROM Flower)>10 BREAK ELSE CONTINUE END