Which of the following is TRUE about subqueries in SQL?

  1. Sub queries must be enclosed in parenthesis

  2. BETWEEN cannot be used with a sub query

  3. Both A. and B.

  4. None of the Above


Correct Option: C

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Sub queries must be enclosed in parenthesis - This option is correct. In SQL, sub queries are enclosed in parenthesis to separate them from the main query. This helps in defining the scope of the sub query and makes it clear to the database engine where the sub query begins and ends.

Option B) BETWEEN cannot be used with a sub query - This option is incorrect. In SQL, the BETWEEN operator can be used with a sub query. The sub query can provide the range of values for the BETWEEN operator to compare against.

Option C) Both A. and B. - This option is incorrect. Option A is correct, but option B is incorrect.

Option D) None of the Above - This option is incorrect. Option A is correct, so the correct answer cannot be "None of the Above".

Therefore, the correct answer is Option C. This option is correct because sub queries in SQL must be enclosed in parenthesis, but the BETWEEN operator can be used with a sub query.

Find more quizzes: