You area database developer for an insurance company. Information about the company'sinsurance policies is stored in a SQL Server 2000 database. You create a tablenamed policy for this database by using the script shown below:CREATE TABLE Policy(PolicyNumber int NOT NULL DEFAULT (0),InsuredLastName CHAR (30) NOT NULL,InsuredFirstName CHAR (20) NOT NULL,InsuredBirthDate dattime NOT NULL,PolicyDate datetime NOT NULL,FaceAmount money NOT NULL,CONSTRAINT PK_Policy PRIMARY KEY (PolicyNumber))Each time the company sells a new policy, the policy must be assigned a uniquepolicy number. The database must assign a new policy number when a new policyis entered. What should you do?
A. Create an INSTEAD OF INSERT trigger to generate a new policy number, and include the policy number in the data instead into the table.
B. Create an INSTEAD OF UPDATE trigger to generate a new policy number, and include the policy number in the data inserted into the table.
Create an AFTER UPDATE trigger to generate a new policy number, and include the policy number in the data inserted into the table.
D. Replace the DEFAULT constraint with a AFTER INSERT trigger that generates a new policy number and includes the policy number in the data inserted into the table.
查看答案
You are a database developer for a marketing firm. You have designed aquarterly sales view. This view joins several tables and calculates aggregateinformation. You create a view. You want to provide a parameterised queryto access the data contained in your view. The output will be used in otherSELECT lists. How should you accomplish this goal?
A. Use an ALTER VIEW statement to add the parameter value tothe view definition.
B. Create a stored procedure that accepts the parameter asinput and returns a rowset with the result set.
Create a scalar user-defined function that accepts theparameter as input.
D. Create an inline user-defined function that accepts theparameter as input
设关系R(A,B,C)和关系S(B,C,D),那么与R⋈S等价的关系代数表达式是
A. σ2=4(R⋈S)
B. σ2=4(R×S)
C. σ2=1(R⋈S)
D. σ2=1(R×S)
Sql语句:select * from students where SNO like‘010[^0]%[A,B,C]%’,可能会查询出的SNO是()。
A. 01053090A
B. Hm3?
C. 01003090A01
D. 01053090D09
E. 0100A01
关于Truncate table, 以下()描述是错误的。
A. Truncate table可跟Where从句,根据条件进行删除。
B. Truncate table可以删除表中所有数据。
C. 触发器对Truncate table依然有效。
D. delete比Truncate table速度快。