单选题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 tab2B SELECT r1 AS retval FROM

题目
单选题
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


相似考题
参考答案和解析
正确答案: D
解析: 暂无解析
更多“单选题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 tab2B SELECT r1 AS retval FROM”相关问题
  • 第1题:

    Given the following two tables:TAB1 C1 C21 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY5 Europe 6 North America 7 South AmericaWhich of the following SQL statements will insert all rows found in table TAB2 into table TAB1?()

    A.INSERT INTO tab1 SELECT cx, cy FROM tab2

    B.INSERT INTO tab1 VALUES (tab2.cx, tab2.cy)

    C.INSERT INTO tab1 VALUES (SELECT cx, cy FROM tab2)

    D.INSERT INTO tab1 (c1, c2) VALUES (SELECT cx, cy FROM tab2)


    参考答案:A

  • 第2题:

    Routers R1 and R2 are EIGRP neighbors. R1 has been configured with the eigrp stub connected command.Which of the following is true as a result?()

    A.R1 can learn EIGRP routes from R2, but R2 cannot learn EIGRP routes from R1

    B.R1 can send IP packets to R2, but R2 cannot send IP packets to R1

    C.R2 no longer learns EIGRP routes from R1 for routes not connected to R1

    D.R1 no longer replies to R2‘s Query messages

    E.R2n o longer sends to R1 Query messages


    参考答案:C, E

  • 第3题:

    In which of the following situations should correlation names be used?()

    • A、A table referenced in the FROM clause has no indexed column.
    • B、The table referenced in the FROM clause has more than 200 columns.
    • C、Two or more tables in the FROM clause have identical column names.
    • D、The FROM clause contains two or more tables in the SELECT statement.

    正确答案:C

  • 第4题:

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

    • A、SELECT * FROM T1 MINUS SELECT * FROM T2
    • B、SELECT * FROM T1 EXCEPT SELECT * FROM T2
    • C、SELECT * FROM T2 UNION EXCEPT SELECT * FROM T1
    • D、SELECT * FROM T1 NOT EXISTS SELECT * FROM T2

    正确答案:B

  • 第5题:

    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)

    正确答案:B

  • 第6题:

    Given the following function: CREATE FUNCTION emplist ( ) RETURNS TABLE ( id CHAR(6) , firstname VARCHAR(12) , lastname VARCHAR(15) ) LANGUAGE SQL BEGIN ATOMIC RETURN SELECT EMPNO, FIRSTNME, LASTNAME FROM EMPLOYEE WHERE WORKDEPT IN ('A00', 'B00'); END How can this function be used in an SQL statement?

    • A、SELECT TABLE(EMPLIST()) FROM EMPLOYEE
    • B、SELECT TABLE(EMPLIST()) AS t FROM EMPLOYEE
    • C、SELECT EMPLIST(id, firstname, lastname) FROM EMPLOYEE
    • D、SELECT id, firstname, lastname FROM TABLE(EMPLIST()) AS t

    正确答案:D

  • 第7题:

    Given the following two tables: TAB1 C1 C2 1 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY 5 Europe 6 North America 7 South America Which of the following SQL statements will insert all rows found in table TAB2 into table TAB1?()

    • A、INSERT INTO tab1 SELECT cx, cy FROM tab2
    • B、INSERT INTO tab1 VALUES (tab2.cx, tab2.cy)
    • C、INSERT INTO tab1 VALUES (SELECT cx, cy FROM tab2)
    • D、INSERT INTO tab1 (c1, c2) VALUES (SELECT cx, cy FROM tab2)

    正确答案:A

  • 第8题:

    单选题
    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)


    正确答案: D
    解析: 暂无解析

  • 第9题:

    单选题
    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)


    正确答案: A
    解析: 暂无解析

  • 第10题:

    单选题
    Given the following two tables: TAB1 C1 C2 1 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY 5 Europe 6 North America 7 South America Which of the following SQL statements will insert all rows found in table TAB2 into table TAB1?()
    A

    INSERT INTO tab1 SELECT cx, cy FROM tab2

    B

    INSERT INTO tab1 VALUES (tab2.cx, tab2.cy)

    C

    INSERT INTO tab1 VALUES (SELECT cx, cy FROM tab2)

    D

    INSERT INTO tab1 (c1, c2) VALUES (SELECT cx, cy FROM tab2)


    正确答案: B
    解析: 暂无解析

  • 第11题:

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

    SELECT * FROM T1 MINUS SELECT * FROM T2

    B

    SELECT * FROM T1 EXCEPT SELECT * FROM T2

    C

    SELECT * FROM T2 UNION EXCEPT SELECT * FROM T1

    D

    SELECT * FROM T1 NOT EXISTS SELECT * FROM T2


    正确答案: A
    解析: 暂无解析

  • 第12题:

    单选题
    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)


    正确答案: C
    解析: 暂无解析

  • 第13题:

    Which of the following statements eliminates all but one of each set of duplicate rows in the DEPT column in the STAFF table?()

    A.SELECT UNIQUE dept FROM staff

    B.SELECT DISTINCT dept FROM staff

    C.SELECT (dept) UNIQUE FROM staff

    D.SELECT (dept) DISTINCT FROM staff


    参考答案:B

  • 第14题:

    Routers R1 and R2 are EIGRP neighbors. R1 has been configured with the eigrp stub connected command. Which of the following is true as a result?()

    • A、R1 can learn EIGRP routes from R2, but R2 cannot learn EIGRP routes from R1
    • B、R1 can send IP packets to R2, but R2 cannot send IP packets to R1
    • C、R2 no longer learns EIGRP routes from R1 for routes not connected to R1
    • D、R1 no longer replies to R2's Query messages
    • E、R2n o longer sends to R1 Query messages

    正确答案:C,E

  • 第15题:

    Which of the following statements eliminates all but one of each set of duplicate rows in the DEPT column in the STAFF table?()

    • A、SELECT UNIQUE dept FROM staff
    • B、SELECT DISTINCT dept FROM staff
    • C、SELECT (dept) UNIQUE FROM staff
    • D、SELECT (dept) DISTINCT FROM staff

    正确答案:B

  • 第16题:

    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

    正确答案:B

  • 第17题:

    Given the following statements: CREATE TABLE tab1 (col1 INT); CREATE TABLE tab2 (col1 INT); CREATE TRIGGER trig1 AFTER UPDATE ON tab1 REFERENCING NEW AS new1 FOR EACH ROW MODE DB2SQL INSERT INTO tab2 VALUES(new1.col1); INSERT INTO tab1 VALUES(2),(3); What is the result of the following query? SELECT count(*) FROM tab2;()

    • A、3
    • B、2
    • C、1
    • D、0

    正确答案:D

  • 第18题:

    Given the following two tables: TAB1 C1 C2 A 11 B 12 C 13 TAB2 CX CY A 21 C 22 D 23 The following results are desired: C1 C2 CX CY A 11 A 21 C 13 C 22 -- --D 23 Which of the following queries will yield the desired results?()

    • A、SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx
    • B、SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx
    • C、SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx
    • D、SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON c1=cx

    正确答案:D

  • 第19题:

    单选题
    Given the following two tables: TAB1 C1 C2 1 Antarctica 2 Africa 3 Asia 4 Australia TAB2 CX CY 5 Europe 6 North America 7 South America Which of the following SQL statements will insert all rows found in table TAB2 into table TAB1?()
    A

    INSERT INTO tab1 SELECT cx, cy FROM tab2

    B

    INSERT INTO tab1 VALUES (tab2.cx, tab2.cy)

    C

    INSERT INTO tab1 VALUES (SELECT cx, cy FROM tab2)

    D

    INSERT INTO tab1 (c1, c2) VALUES (SELECT cx, cy FROM tab2)


    正确答案: A
    解析: 暂无解析

  • 第20题:

    单选题
    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


    正确答案: D
    解析: 暂无解析

  • 第21题:

    单选题
    Given the following statements: CREATE TABLE tab1 (col1 INT); CREATE TABLE tab2 (col1 INT); CREATE TRIGGER trig1 AFTER UPDATE ON tab1 REFERENCING NEW AS new1 FOR EACH ROW MODE DB2SQL INSERT INTO tab2 VALUES(new1.col1); INSERT INTO tab1 VALUES(2),(3); What is the result of the following query? SELECT count(*) FROM tab2;()
    A

    3

    B

    2

    C

    1

    D

    0


    正确答案: D
    解析: 暂无解析

  • 第22题:

    多选题
    Routers R1 and R2 are EIGRP neighbors. R1 has been configured with the eigrp stub connected command. Which of the following is true as a result?()
    A

    R1 can learn EIGRP routes from R2, but R2 cannot learn EIGRP routes from R1

    B

    R1 can send IP packets to R2, but R2 cannot send IP packets to R1

    C

    R2 no longer learns EIGRP routes from R1 for routes not connected to R1

    D

    R1 no longer replies to R2's Query messages

    E

    R2n o longer sends to R1 Query messages


    正确答案: B,E
    解析: 暂无解析

  • 第23题:

    单选题
    Given the following two tables: TAB1 C1 C2 A 11 B 12 C 13 TAB2 CX CY A 21 C 22 D 23 The following results are desired: C1 C2 CX CY A 11 A 21 C 13 C 22 -- --D 23 Which of the following queries will yield the desired results?()
    A

    SELECT * FROM tab1 INNER JOIN tab2 ON c1=cx

    B

    SELECT * FROM tab1 LEFT OUTER JOIN tab2 ON c1=cx

    C

    SELECT * FROM tab1 FULL OUTER JOIN tab2 ON c1=cx

    D

    SELECT * FROM tab1 RIGHT OUTER JOIN tab2 ON c1=cx


    正确答案: C
    解析: 暂无解析