单项选择题

The following statements:
CREATE TABLE t1 (col1 INT NOT NULL, PRIMARY KEY(col1)); CREATE TABLE t2 (col1 INT NOT NULL, col2 CHAR(1) NOT NULL, PRIMARY KEY (col1, col2), FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE CASCADE ON UPDATE RESTRICT); CREATE TABLE t3 (col1 INT NOT NULL, col2 INT NOT NULL, PRIMARY KEY (col1, col2),FOREIGN KEY (col1) REFERENCES t1 (col1) ON DELETE NO ACTION ON UPDATE RESTRICT);INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1, 'a'), (1, 'b'), (2,'c'); INSERT INTO t3 VALUES (1, 100), (2, 200), (2,300);
How many rows will be deleted by the following DELETE statement? DELETE FROM t1 WHERE col1= 1;()

A.4
B.3
C.1
D.0


您可能感兴趣的试卷

你可能感兴趣的试题

2.单项选择题Given the following ALTER SEQUENCE statement: ALTER SEQUENCE myseq RESTART WITH 0 INCREMENT BY 1 NO MAXVALUE CACHE 5 ORDER Assuming that the sequence had reached a value of 100 prior to the RESTART, which of the following is true?()

A.The next value will be 0 and the sequence will never use the values 101 to 105.
B.The next value will be 101 to ensure uniqueness between existing and newly generated sequence values.
C.Previously cached values are retained by DB2, and after the restart, will be used for values 101 to 105.
D.The next value will be 0 and DB2 will not ensure uniqueness between existing and newly generated values.

3.单项选择题A DRDA host database resides on a z/OS or an i5/OS system and listens on port 446. The TCP/IP address for this system is 192.168.10.1 and the TCP/IP host name is myhost. Which of the following commands is required to update the local node directory so that a DB2 client can access this DRDA database?()

A.CATALOG TCPIP NODE myhost REMOTE db2srv SERVER 446
B.CATALOG TCPIP NODE mydb2srv REMOTE myhost SERVER 446
C.CATALOG TCPIP NODE myhost REMOTE db2srv SERVER 192.168.10.1
D.CATALOG TCPIP NODE mydb2srv REMOTE myhost SERVER 192.168.10.1

5.单项选择题To which of the following resources can a lock be applied?()

A.Row
B.Alias
C.Bitmap
D.Column

6.单项选择题Application A holds an Update lock on a single row and application B is trying to read that row. If both applications are using isolation level UR, which of the following will occur?()

A.Application B will read the row.
B.Applications A and B will cause a deadlock situation.
C.Application B will wait until application A releases the Update lock.
D.Application A will be terminated so that application B can read the row.

7.单项选择题

Application A is designed to execute the following SQL statements within a single Unit of Work (UOW).
UPDATE employee SET salary = salary * 1.1 WHERE empno='000010' UPDATE department SET deptname = 'NEW dept' WHERE deptno='A00'Application B is designed to execute the following SQL statements within a single Unit of Work (UOW). UPDATE department SET deptname = 'OLD DEPT' WHERE deptno='A00' UPDATE employee SET salary = salary * 0.5 WHERE empno='000010'
Application A and application B execute their first SQL statement at the same time. When application A and application B try to execute their second SQL statement, a deadlock occurs.
What will happen?()
 

A.The database manager will rollback the transaction in both applications.
B.The database manager will rollback the transaction in one of the two applications.
C.Application B will successfully update the EMPLOYEE and DEPARTMENT tables; Application A will be placed in a lock wait state.
D.Application A will successfully update the EMPLOYEE and DEPARTMENT tables; Application B will terminate when the lock timeout value is reached.

8.单项选择题Which of the following is TRUE for the DB2 isolation level Cursor Stability (CS)?()

A.An application process acquires at least a share lock on the current row of every cursor.
B.Any row that is read during a unit of work cannot be changed by other application processes until the unit of work is complete.
C.Any row changed by another application process can be read, even if the change has not been committed by that application process.
D.An application process that issues the same query more than once in a unit of work will not see additional rows caused by other application processes appending new information to the database.

9.单项选择题Which of the following best describes the lock protection provided by DB2 for the current row of a cursor?()

A.The cursor is only protected from updates and deletes by concurrent applications.
B.The row is only protected from positioned updates and deletes that reference another cursor of the same application.
C.The cursor is protected from positioned updates and deletes that reference another cursor of a different application.
D.The row is protected from updates and deletes by the current application and from positioned updates and deletes that reference another cursor of the same application.

10.单项选择题Which of the following resources can be referenced in the LOCK statement?()

A.Row
B.Table
C.Column
D.Table space

最新试题

An application needs to store a 5 MB JPEG image in a DB2 table. Which data type should be specified for the column that will be used for storing the image?()

题型:单项选择题

CREATE TABLE customer (cid BIGINT NOT NULL PRIMARY KEY, info XML) How many names will be returned for this XQuery?()

题型:单项选择题

A user needs to create a trigger that will update table T2 whenever a row is added to table T1. Assuming the user has all appropriate privileges for table T2, which privilege is required on table T1 to create the trigger?()

题型:单项选择题

A table was created using the following DDL:CREATE TABLE employee (id SMALLINT NOT NULL, name VARCHAR(9), dept SMALLINT CHECK (dept BETWEEN 10 AND 100),job CHAR(10) CHECK (job IN ('Sales','Mgr','Clerk')), hiredate DATE, salary DECIMAL(7,2), comm DECIMAL(7,2), PRIMARY KEY (id), CONSTRAINT yearsal CHECK (YEAR(hiredate) > 2004 OR salary > 80500) );Which of the following INSERT statements will fail?()

题型:单项选择题

Which kind of non-sourced UDF can be created so that it only returns a single value?()

题型:单项选择题

Given that tables T1 and T2 contain the following rows:Table T1: C1 C2 1 4 1 3 1 2Table T2: C1 C2 1 1 1 2 1 3Which of the following queries will return only those rows that exist in both T1 and T2?()

题型:单项选择题

Which of the following actions may cause a trigger to be fired?()

题型:单项选择题

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?()

题型:单项选择题

Assuming PUBLIC has been granted all privileges on table T1, which of the following statements would continue to permit any user to add rows to table T1, but not remove them?()

题型:单项选择题

A "trusted" client needs to communicate with a server that has been configured to use CLIENT authentication. Which of the following will be used to verify passwords?()

题型:单项选择题