MCQ | SQL – Sub Queries, Views Clause

SQL Sub Queries, Views Clause MCQ: This section contains the Multiple-Choice Questions & Answers on SQL Sub Queries, Views Clause.
Submitted by Anushree Goswami, on October 28, 2021

SQL Sub Queries, Views Clause MCQs

1. A Sub query is an SQL expression that is placed ____ another SQL statement.

  1. Before
  2. After
  3. Inside
  4. Outside

Answer: C) Inside

Explanation:

A Sub query is an SQL expression that is placed inside another SQL statement.

Discuss this Question


2. With which of the following statement(s) can the SQL sub queries be used?

  1. SELECT
  2. UPDATE
  3. INSERT
  4. All of the above

Answer: D) All of the above

Explanation:

SQL sub queries can be used with SELECT, UPDATE, INSERT and DELETE statements.

Discuss this Question


3. Whenever a sub query appears in SQL, it is enclosed within ____ and placed to the ____ of the SQL operators.

  1. Brackets, Left
  2. Brackets, Right
  3. Parenthesis, Left
  4. Parenthesis, Right

Answer: D) Parenthesis, Right

Explanation:

Whenever a sub query appears in SQL, it is enclosed within parenthesis and placed to the right of the SQL operators.

Discuss this Question


4. Which of the following clause cannot be used in SQL sub queries?

  1. GROUP BY
  2. ORDER BY
  3. DELETE
  4. FROM

Answer: B) ORDER BY

Explanation:

ORDER BY clause cannot be used in SQL sub queries.

Discuss this Question


5. In order to prevent multiple records from being returned by the sub query, ____ must be used before the sub query.

  1. Many Value Operators
  2. Multiple Value Operators
  3. Single Value Operator
  4. Unique Value Operator

Answer: B) Multiple Value Operators

Explanation:

In order to prevent multiple records from being returned by the sub query, multiple value operators must be used before the sub query.

Discuss this Question


6. The ____ operator cannot be used with the sub query, but within it.

  1. IN
  2. INTO
  3. BETWEEN
  4. JOIN

Answer: C) BETWEEN

Explanation:

The BETWEEN operator cannot be used with the sub query, but within it.

Discuss this Question


7. An SQL ____ is a virtual table, whose contents are based on the SQL statement's results.

  1. Concatenate
  2. Virtual
  3. View
  4. None of the above

Answer: C) View

Explanation:

An SQL View is a virtual table, whose contents are based on the SQL statement's results.

Discuss this Question


8. We can create View in SQL using –

  1. CREATE statement
  2. CREATE VIEW statement
  3. VIEW CREATE statement
  4. SQL VIEW statement

Answer: B) CREATE VIEW statement

Explanation:

We can create View in SQL using CREATE VIEW statement.

Discuss this Question


9. What is TRUE about UPDATE in SQL VIEW?

  1. Views that depend on a single table can be updated.
  2. An update of a view created from more than one table will not be allowed by SQL.
  3. There should be no NULL values in the fields of view.
  4. All of the above

Answer: D) All of the above

Explanation:

UPDATE in SQL VIEW states that-

  1. Views that depend on a single table can be updated.
  2. An update of a view created from more than one table will not be allowed by SQL.
  3. There should be no NULL values in the fields of view.

Discuss this Question


10. When SELECT statements used to create Views contain ____ clauses, the views cannot be updated.

  1. JOIN
  2. HAVING
  3. GROUP BY
  4. All of the above

Answer: D) All of the above

Explanation:

When SELECT statements used to create Views contain JOIN, HAVING, or GROUP BY clauses, the views cannot be updated.

Discuss this Question





Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.