单选题Which of the following will be a consequence of defining the column IDCOL2 in TABLE2 as a foreign key referencing the primary key (IDCOL1) of TABLE1?()ADB2 will no longer allow updating the value of IDCOL1 in TABLE1.BWhen inserting a row in TABLE2, the only values that DB2 will allow for IDCOL2 are the existing values of IDCOL1.CWhen inserting a row in TABLE2, DB2 will only allow foreign values for IDCOL2, that is values which do not exist in IDCOL1.DWhen a SELECT statement joins TABLE1 with TABLE2, DB2 will automatically add the condition TABLE1.IDCOL1=TABLE2.IDCOL2 if not specified in the statement.

单选题
Which of the following will be a consequence of defining the column IDCOL2 in TABLE2 as a foreign key referencing the primary key (IDCOL1) of TABLE1?()
A

DB2 will no longer allow updating the value of IDCOL1 in TABLE1.

B

When inserting a row in TABLE2, the only values that DB2 will allow for IDCOL2 are the existing values of IDCOL1.

C

When inserting a row in TABLE2, DB2 will only allow foreign values for IDCOL2, that is values which do not exist in IDCOL1.

D

When a SELECT statement joins TABLE1 with TABLE2, DB2 will automatically add the condition TABLE1.IDCOL1=TABLE2.IDCOL2 if not specified in the statement.


参考解析

解析: 暂无解析

相关考题:

Which constraint can be defined only at the column level? () A. UNIQUEB. NOT NULLC. CHECKD. PRIMARY KEYE. FOREIGN KEY

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?()A.A check constraint on the EMPLOYEE tableB.A unique constraint on the EMPLOYEE table WORKDEPT columnC.A foreign key reference from the DEPARTMENT tables DEPTNO column to the WORKDEPT column of the EMPLOYEE tableD.A foreign key reference from the EMPLOYEE tables WORKDEPT column to the DEPTNO column of the DEPARTMENT table

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?() A.Define a UNIQUE constraint on the columns NEXT_STEPNO and STEPNO.B.Define a CHECK constraint on the NEXT_STEPNO column (NEXT_STEPNO = STEPNO).C.Define column STEPNO as the primary key of TABLEX and column NEXT_STEPNO as a foreign key referencing column STEPNO of the same table.D.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.

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?() A.Define the column MAINID as NOT UPDATABLEB.Define the column MAINID as a PRIMARY KEYC.Define the column MAINID as a FOREIGN KEYD.Define an UPDATE trigger on table TABLEX

Which of the following will be a consequence of defining the column IDCOL2 in TABLE2 as a foreign key referencing the primary key (IDCOL1) of TABLE1?() A.DB2 will no longer allow updating the value of IDCOL1 in TABLE1.B.When inserting a row in TABLE2, the only values that DB2 will allow for IDCOL2 are the existing values of IDCOL1.C.When inserting a row in TABLE2, DB2 will only allow foreign values for IDCOL2, that is values which do not exist in IDCOL1.D.When a SELECT statement joins TABLE1 with TABLE2, DB2 will automatically add the condition TABLE1.IDCOL1=TABLE2.IDCOL2 if not specified in the statement.

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?()A、Define a UNIQUE constraint on the columns NEXT_STEPNO and STEPNO.B、Define a CHECK constraint on the NEXT_STEPNO column (NEXT_STEPNO = STEPNO).C、Define column STEPNO as the primary key of TABLEX and column NEXT_STEPNO as a foreign key referencing column STEPNO of the same table.D、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.

You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a database named named Dworks in the instance. The Dworks table has a table named BillDetails which has a clustered primary key named BillId on the BillId column. The BillDetails table has a single XML column named GoodsDetails. The XML column has an XML index and XML data are stored in this XML column. A new column named GoodsID is added to the BillDetails table. GoodsID must be included in the primary key.  So what action should you perform to achieve this goal?()  A、You should drop the XML index on the table. Modify the primary key. Recreate the XML index B、You should alter the XML index and set the ALLOW_ROW_LOCKS = OFF option. Alter the primary key and set the ALLOW_ROW_LOCKS = ON option. C、You should move the XML data to a temporary table. Clear the XML data from the original table by setting the GoodsDetails column to NULL. Modify the primary key. Repopulate the ProductSpecs column. D、You should disable the XML index on the GoodsDetails column. Modify the primary key.Enable the XML index on the ProductSpecs column.

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?()A、A check constraint on the EMPLOYEE tableB、A unique constraint on the EMPLOYEE table WORKDEPT columnC、A foreign key reference from the DEPARTMENT tables DEPTNO column to the WORKDEPT column of the EMPLOYEE tableD、A foreign key reference from the EMPLOYEE tables WORKDEPT column to the DEPTNO column of the DEPARTMENT table

Which of the following will be a consequence of defining the column IDCOL2 in TABLE2 as a foreign key referencing the primary key (IDCOL1) of TABLE1?()A、DB2 will no longer allow updating the value of IDCOL1 in TABLE1.B、When inserting a row in TABLE2, the only values that DB2 will allow for IDCOL2 are the existing values of IDCOL1.C、When inserting a row in TABLE2, DB2 will only allow foreign values for IDCOL2, that is values which do not exist in IDCOL1.D、When a SELECT statement joins TABLE1 with TABLE2, DB2 will automatically add the condition TABLE1.IDCOL1=TABLE2.IDCOL2 if not specified in the statement.

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?()A、Define the column MAINID as NOT UPDATABLEB、Define the column MAINID as a PRIMARY KEYC、Define the column MAINID as a FOREIGN KEYD、Define an UPDATE trigger on table TABLEX

When defining a referential constraint between the parent table T2 and the dependent table T1, which of the following is true?()A、The list of column names in the FOREIGN KEY clause can be a subset of the list of column names in the primary key of T2 or a UNIQUE constraint that exists on T2.B、The list of column names in the FOREIGN KEY clause can be a subset of the list of column names in the primary key of T1 or a UNIQUE constraint that exists on T1.C、The list of column names in the FOREIGN KEY clause must be identical to the list of column names in the primary key of T2 or a UNIQUE constraint that exists on T2.D、The list of column names in the FOREIGN KEY clause must be identical to the list of column names in the primary key of T1 or a UNIQUE constraint that exists on T1.

Which two statements are true about the primary key constraint in a table? ()A、It is not possible to disable the primary key constraint.B、It is possible to have more than one primary key constraint in a single table.C、The primary key constraint can be referred by only one foreign key constraint.D、The primary key constraint can be imposed by combining more than one column.E、The non-deferrable primary key constraint creates an unique index on the primary key column if it is not already indexed.

Which two statements are true about constraints? ()A、The UNIQUE constraint does not permit a null value for the column.B、A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.C、The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index.D、The NOT NULL constraint ensures that null values are not permitted for the column.

Which two statements are true about a bitmap index? ()A、It is recommended for the columns that have unique values.B、It can be converted to a B-tree index by using the ALTER INDEX command.C、It has a bitmap segment for each distinct value in the key column, containing a string of bits in which each bit represents the presence or absence of a key column value.D、Updating the key column locks the whole bitmap segment that contains the bit for the key value to be updated.

Which statement describes the effect on an index, when the indexed column for the rows is updatedin the base table()A、An update in a leaf row takes place.B、The index becomes invalid after the update.C、The leaf block containing the row to be updated is marked as invalid.D、A row in the leaf block of the index for the key value is logically deleted and a new leaf row is inserted

Which constraint can be defines only at the column level?()A、UNIQUEB、NOT NULLC、CHECKD、PRIMARY KEYE、FOREIGN KEY

Examine the command:   ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;   What does the command accomplish?()A、Creates an additional copy of the database online redo log files. B、Stores the primary key column values of each row involved in a DML operation in the online redo log files. C、Stores the primary key column values of each row involved in a DML operation in the supplemental log files. D、Stores the old and new primary key column values of each row involved in a DML operation only when the primary key is modified in the online redo log files.

单选题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?()ADefine a UNIQUE constraint on the columns NEXT_STEPNO and STEPNO.BDefine a CHECK constraint on the NEXT_STEPNO column (NEXT_STEPNO = STEPNO).CDefine column STEPNO as the primary key of TABLEX and column NEXT_STEPNO as a foreign key referencing column STEPNO of the same table.DDefine column NEXT_STEPNO as the primary key of TABLEX and column STEPNO as a foreign key referencing column NEXT_STEPNO in the same table.

单选题Examine the command:   ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;   What does the command accomplish?()ACreates an additional copy of the database online redo log files. BStores the primary key column values of each row involved in a DML operation in the online redo log files. CStores the primary key column values of each row involved in a DML operation in the supplemental log files. DStores the old and new primary key column values of each row involved in a DML operation only when the primary key is modified in the online redo log files.

单选题Which statement describes the effect on an index, when the indexed column for the rows is updatedin the base table()AAn update in a leaf row takes place.BThe index becomes invalid after the update.CThe leaf block containing the row to be updated is marked as invalid.DA row in the leaf block of the index for the key value is logically deleted and a new leaf row is inserted

单选题You work in a company which uses SQL Server 2008. You are the administrator of the company database. Now you are in charge of a SQL Server 2008 instance. There is a database named named Dworks in the instance. The Dworks table has a table named BillDetails which has a clustered primary key named BillId on the BillId column. The BillDetails table has a single XML column named GoodsDetails. The XML column has an XML index and XML data are stored in this XML column. A new column named GoodsID is added to the BillDetails table. GoodsID must be included in the primary key.  So what action should you perform to achieve this goal?()AYou should drop the XML index on the table. Modify the primary key. Recreate the XML index BYou should alter the XML index and set the ALLOW_ROW_LOCKS = OFF option. Alter the primary key and set the ALLOW_ROW_LOCKS = ON option. CYou should move the XML data to a temporary table. Clear the XML data from the original table by setting the GoodsDetails column to NULL. Modify the primary key. Repopulate the ProductSpecs column. DYou should disable the XML index on the GoodsDetails column. Modify the primary key.Enable the XML index on the ProductSpecs column.

多选题Which two statements are true about constraints? ()AThe UNIQUE constraint does not permit a null value for the column.BA UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.CThe PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index.DThe NOT NULL constraint ensures that null values are not permitted for the column.

单选题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?()ACREATE 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')), );BCREATE 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') );CCREATE 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) );DCREATE 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')) );

多选题Which two statements are true about the primary key constraint in a table? ()AIt is not possible to disable the primary key constraint.BIt is possible to have more than one primary key constraint in a single table.CThe primary key constraint can be referred by only one foreign key constraint.DThe primary key constraint can be imposed by combining more than one column.EThe non-deferrable primary key constraint creates an unique index on the primary key column if it is not already indexed.

单选题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?()ADefine the column MAINID as NOT UPDATABLEBDefine the column MAINID as a PRIMARY KEYCDefine the column MAINID as a FOREIGN KEYDDefine an UPDATE trigger on table TABLEX

单选题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?()AA check constraint on the EMPLOYEE tableBA unique constraint on the EMPLOYEE table WORKDEPT columnCA foreign key reference from the DEPARTMENT tables DEPTNO column to the WORKDEPT column of the EMPLOYEE tableDA foreign key reference from the EMPLOYEE tables WORKDEPT column to the DEPTNO column of the DEPARTMENT table

单选题When defining a referential constraint between the parent table T2 and the dependent table T1, which of the following is true?()AThe list of column names in the FOREIGN KEY clause can be a subset of the list of column names in the primary key of T2 or a UNIQUE constraint that exists on T2.BThe list of column names in the FOREIGN KEY clause can be a subset of the list of column names in the primary key of T1 or a UNIQUE constraint that exists on T1.CThe list of column names in the FOREIGN KEY clause must be identical to the list of column names in the primary key of T2 or a UNIQUE constraint that exists on T2.DThe list of column names in the FOREIGN KEY clause must be identical to the list of column names in the primary key of T1 or a UNIQUE constraint that exists on T1.