QUESTION NO: 31
Which two statements about sub queries are true? (Choose two.)关于子查询
A. A sub query should retrieve only one row.
B. A sub query can retrieve zero or more rows.
C. A sub query can be used only in SQL query statements.
D. Sub queries CANNOT be nested by more than two levels.
E. A sub query CANNOT be used in an SQL query statement that uses group functions.
F. When a sub query is used with an inequality comparison operator in the outer SQL statement,
the column list in the SELECT clause of the sub query should contain only one column.
Answer: B,F
Explanation: sub query can retrieve zero or more rows, sub query is used with an
inequality comparison operator in the outer SQL statement, and the column list in the SELECT
clause of the sub query should contain only one column.
Which two statements about sub queries are true? (Choose two.)关于子查询
A. A sub query should retrieve only one row.
B. A sub query can retrieve zero or more rows.
C. A sub query can be used only in SQL query statements.
D. Sub queries CANNOT be nested by more than two levels.
E. A sub query CANNOT be used in an SQL query statement that uses group functions.
F. When a sub query is used with an inequality comparison operator in the outer SQL statement,
the column list in the SELECT clause of the sub query should contain only one column.
Answer: B,F
Explanation: sub query can retrieve zero or more rows, sub query is used with an
inequality comparison operator in the outer SQL statement, and the column list in the SELECT
clause of the sub query should contain only one column.
A,子查询至少返回一行,A不对。
B,子查询可以返回一行或者多行,也可以返回0行。B对
C,子查询不仅可以用在查询语句,也可以用在插入和更新语句。所以C错
D,WHERE子句中的嵌套子查询最多能嵌套255层,所以不仅仅是两层,所以D错误
E
,子查询不能用在查询语句group方法,错误。
F,子查询可以出现在任何一方的一个比较运算符。select查询语句必须包含至少一列。