单项选择题

Given the following two tables:
TAB1 R1
A A A B B C C D E TAB2 R2
A A B B C C D
Which of the following queries returns the following result set? RETVAL E()

A.SELECT r1 AS retval FROM tab1 INTERSECT SELECT r2 AS retval FROM tab2
B.SELECT r1 AS retval FROM tab1 EXCEPT SELECT r2 AS retval FROM tab2
C.SELECT DISTINCT r1 AS retval FROM tab1, tab2 WHERE r1 <> r2
D.SELECT r1 AS retval FROM tab1 UNION SELECT r2 AS retval FROM tab2


您可能感兴趣的试卷

你可能感兴趣的试题

2.单项选择题Which of the following SQL statements will return the year and average salary for all employees hired within a given year that have a salary greater than $30,000?()

A.SELECT * FROM t1 UNION SELECT * FROM t2
B.SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2
C.SELECT * FROM t1 INTERSECT SELECT * FROM t2
D.SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)

3.单项选择题

Given the following table definition:
STOCK: item VARCHAR(30) status CHAR(1) quantity INT price DEC(7,2)
If items are indicated to be out of stock by setting STATUS to NULL and QUANTITY and PRICE to zero, which of the following statements would be used to update the STOCK table to indicate that all the items whose description begins with the letter "S" are out of stock?()

A.UPDATE stock SET (status = NULL; quantity, price = 0) WHERE item LIKE S%
B.UPDATE stock SET (status, quantity, price) = (NULL, 0, 0) WHERE item LIKE S%
C.UPDATE stock SET status = NULL, SET quantity = 0, SET price = 0 WHERE item LIKE 'S%'
D.UPDATE stock SET (status = NULL), (quantity = 0), (price = 0) WHERE item LIKE S%

5.单项选择题Which of the following will begin a new unit of work?()

A.The CONNECT statement
B.The first FETCH of a cursor
C.The BEGIN TRANSACTION statement
D.The first executable SQL statement

6.单项选择题

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

A.SELECT * FROM t1 UNION SELECT * FROM t2
B.SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2
C.SELECT * FROM t1 INTERSECT SELECT * FROM t2
D.SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)

10.单项选择题Which of the following statements allows USER1 to take away read access on the table ORG.TAB1 from USER2?()

A.REVOKE SELECT FROM user2 ON TABLE org.tab1
B.REVOKE SELECT ON TABLE org.tab1 FROM user2
C.REVOKE READ ACCESS FROM user2 ON TABLE org.tab1
D.REVOKE READ ACCESS ON TABLE org.tab1 FROM user2

最新试题

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

题型:单项选择题

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

题型:单项选择题

On which of the following database objects may the SELECT privilege be controlled?()

题型:单项选择题

Which of the following statements is used to grant user TOM and Application team APPGRP the ability to add data to table TAB1?()

题型:单项选择题

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

题型:单项选择题

The opening of cursor CSR01 produces the following result set:STUDENT LASTNM FIRSTNM CLASSNO 123 Brown John T100 213 Bailey JamesT100 312 Carter Arlene T210 465 Chas Devon T305 546 Davis Steven T405If this Fetch statement is executed: FETCH csr01 INTO :studnum, :firstname, :lastname, :class Which of the following DELETE statements will cause this row to be deleted?()

题型:单项选择题

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

题型:单项选择题

Which of the following constraint types can be used to ensure the value of an INTEGER column references only positive values?()

题型:单项选择题

Which of the following database objects can be used to raise an error if a table is updated?()

题型:单项选择题

A user utilizing an alias to update a subset of columns in a table must have UPDATE privileges on which of the following DB2 objects?()

题型:单项选择题