A check constraint on the EMPLOYEE table
A unique constraint on the EMPLOYEE table WORKDEPT column
A foreign key reference from the DEPARTMENT tables DEPTNO column to the WORKDEPT column of the EMPLOYEE table
A foreign key reference from the EMPLOYEE tables WORKDEPT column to the DEPTNO column of the DEPARTMENT table
第1题:
A.Define the column MAINID as NOT UPDATABLE
B.Define the column MAINID as a PRIMARY KEY
C.Define the column MAINID as a FOREIGN KEY
D.Define an UPDATE trigger on table TABLEX
第2题:
What type of constraint can be used to ensure that, in any given row in a table, the value of one column never exceeds the value of another column?()
第3题:
You are planning to import customer data from the Customer table and the Country table in your SQL Server 2000 database into a SQL Server 2005 database. You want to ensure that during the import process,each value in the CountryCode column of the Customer table has a corresponding record in the CountryCode column in the Country table of the SQL Server 2005 database. You define a foreign key between these two tables. Thus,referential integrity will guarantee that the import routine fails if there are any records where a CountryCode value does not exist in the Country table but does exist in the Customer table. You need to ensure that the import process does not fail if records are encountered that do not exist in the Country table. What should you do?()
第4题:
What type of constraint is used to ensure that each row inserted into the EMPLOYEE table with a value in the WORKDEPT column has a row with a corresponding value in the DEPTNO column of the DEPARTMENT table?()
第5题:
Which of the following can be used to ensure that once a row has been inserted in table TABLEX, the column MAINID in that row cannot be updated?()
第6题:
You are responsible for managing the database schema for an order entry application in a SQL Server 2005 database. After a design review, a member of the development staff asks you to add a new column named CommissionRate to the Product table. Because the actual commission rates for all products are not known at this time, each product has a default commission rate of 12 percent. The rate can be modified as necessary. You add the new column. You need to configure the table to assign the default value as efficiently as possible. What should you do?()
第7题:
You are modifying a table named Product in a SQL Server 2005 database. You want to add a new column named FriendlyName to the Product table. A friendly name for each product will be stored in this column. The table currently contains data. The sales department has not yet created a friendly name for each product. FriendlyName is a required value for each product. You want to add this new column by using the least amount of effort. What should you do?()
第8题:
Check
Range
Referential
Informational
第9题:
CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );
CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );
CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );
CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) );
第10题:
Define the new column as NULL.Update the FriendlyName column to the same value as the productName column. Alter the FriendlyName column to be NOT NULL.
Define the new column as NOT NULL with a default value of ’Undefined.’
Define the new column as NULL. Use application logic to enforce the data constraint.
Define the new column as NULL with a default value of ’Undefined.’
第11题:
A check constraint on the EMPLOYEE table
A unique constraint on the EMPLOYEE table WORKDEPT column
A foreign key reference from the DEPARTMENT tables DEPTNO column to the WORKDEPT column of the EMPLOYEE table
A foreign key reference from the EMPLOYEE tables WORKDEPT column to the DEPTNO column of the DEPARTMENT table
第12题:
Drop the foreign key. Import the data by using the script. Re-create the foreign key.
Create a CHECK constraint.
Create a DML INSTEAD OF trigger that writes the failed records to a file or table.
Create a DML AFTER trigger that writes the failed records to a file or table.
第13题:
A.Check
B.Range
C.Referential
D.Informational
第14题:
Which of the following scenarios will ensure that the value of the NEXT_STEPNO column in a given row of table TABLEX exists as a value of column STEPNO (usually in another row) in the same table?()
第15题:
You are a database administrator for your company. The company uses a SQL Server 2005 database that includes a table named Inventory. The table contains a column named Price. A company policy states that the value in the Price column cannot be decreased by more than 10 percent in any single database operation. Updates to the Price column are made by various means, including by using ad hoc queries. You need to ensure that this company policy is enforced. What should you do?()
第16题:
Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()
第17题:
The SCOTT user has an index on the ITEM_DESC column of the ITEM table. As part of the year-ending task, SCOTT updates the ITEM_DESC column for most of the rows in the ITEM table. How does this change to the table affect the index?()
第18题:
You create a Web Form that displays a GridView. The GridViews data source is a DataSet named dsOrders. The DataSet contains two DataTables named Orders and OrderDetails. You create a relation between the two DataTables using the following code segment. (Line numbers are included for reference only.)01 dtOrders = dsOrders.Tables[“Orders”]; 02 dtOrderDetails = dsOrders.Tables[“OrderDetail”]; 03 colParent = dtOrders.Columns[“OrderID”]; 04 colChild = dtOrderDetails.Columns[“ParentOrderID”]; 05 dsOrders.Relations.Add(“Rell”, colParent, colChild, false); You need to find the cause of the exception being raised in line 05. What should you do? ()
第19题:
Define a UNIQUE constraint on the columns NEXT_STEPNO and STEPNO.
Define a CHECK constraint on the NEXT_STEPNO column (NEXT_STEPNO = STEPNO).
Define column STEPNO as the primary key of TABLEX and column NEXT_STEPNO as a foreign key referencing column STEPNO of the same table.
Define column NEXT_STEPNO as the primary key of TABLEX and column STEPNO as a foreign key referencing column NEXT_STEPNO in the same table.
第20题:
An update in a leaf row takes place.
The index becomes invalid after the update.
The leaf block containing the row to be updated is marked as invalid.
A row in the leaf block of the index for the key value is deleted and inserted.
第21题:
Create an INSERT trigger to assign the default value to each item in the table.
Create a CHECK constraint to validate the data and to assign the default value to each item in the table.
Create an UPDATE trigger to update the default value for each new item in the table.
Create a DEFAULT constraint to assign the default value specifying the WITH VALUES argument.
第22题:
Define the column MAINID as NOT UPDATABLE
Define the column MAINID as a PRIMARY KEY
Define the column MAINID as a FOREIGN KEY
Define an UPDATE trigger on table TABLEX
第23题:
ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;
ALTER TABLE customers MODIFY CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;
ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn NOT NULL;
ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn IS NOT NULL;
ALTER TABLE customers MODIFY name CONSTRAINT cust_name_nn NOT NULL;
ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name NOT NULL;
第24题:
Create a trigger that rolls back changes to the Price column that violate company policy.
Create a stored procedure that disallows changes to the Price column that violate company policy.
On the Price column, create a check constraint that requires a specified minimum value.
On the Price column, create a foreign key constraint to a table that contains valid prices.