MCQ | SQL – Auto Increment, Like, Commit and Rollback

SQL Auto Increment, Like, Commit and Rollback MCQ: This section contains the Multiple-Choice Questions & Answers on SQL Auto Increment, Like, Commit and Rollback.
Submitted by Anushree Goswami, on October 24, 2021

SQL Auto Increment, Like, Commit and Rollback MCQs

1. Which of the following is TRUE about SQL Auto Increment?

  1. It increments the unique number automatically.
  2. It decrements the unique number automatically.
  3. It keeps the unique number constant
  4. None of the above

Answer: A) It increments the unique number automatically

Explanation:

SQL Auto Increment increments the unique number automatically.

Discuss this Question


2. Which of the following is the feature(s) of SQL Auto Increment?

  1. In some cases you may not have any unique identifying characteristics in data; therefore, it makes sense to create a Primary Key.
  2. Explicitly initializing and modifying the auto-increment value is possible at any time.
  3. Record identifiers can easily be created that are unique to each record.
  4. All of the above

Answer: D) All of the above

Explanation:

Features of SQL Auto Increment are:

  1. In some cases you may not have any unique identifying characteristics in data; therefore, it makes sense to create a Primary Key.
  2. Explicitly initializing and modifying the auto-increment value is possible at any time.
  3. Record identifiers can easily be created that are unique to each record.
  4. Automatic incrementing allows flexibility in handling gaps between records.
  5. Syntax-speaking, auto-increment queries in SQL are straightforward.

Discuss this Question


3. Which keyword is used in SQL Server to implement the auto increment?

  1. UNIQUE
  2. IDENTITY
  3. INCREMENT
  4. ADD

Answer: B) IDENTITY

Explanation:

IDENTITY keyword is used in SQL Server to implement the auto-increment.

Discuss this Question


4. In SQL, Like is a ____ operator.

  1. Relational
  2. Logical
  3. Additional
  4. Unique

Answer: B) Logical

Explanation:

In SQL, LIKE is an Additional operator.

Discuss this Question


5. SQL Like is NOT used with which of the following statement(s)?

  1. DELETE
  2. SELECT
  3. UPDATE
  4. ALTER

Answer: D) ALTER

Explanation:

SQL LIKE is used with DELETE, SELECT and UPDATE statements and not with ALTER statements.

Discuss this Question


6. The character(s) which are used independently or in conjunction with SQL Like Operator:

  1. %
  2. _
  3. Both A. and B.
  4. None of the above

Answer: C) Both A. and B.

Explanation:

The characters which are used independently or in conjunction with SQL Like Operator are '%' & '_'.

Discuss this Question


7. Which of the following is/are transaction control commands in SQL?

  1. Commit
  2. Rollback
  3. Both A. and B.
  4. None of the above

Answer: C) Both A. and B.

Explanation:

Commit and Rollback are transaction control commands in SQL.

Discuss this Question


8. A single unit of work for all commands executed consecutively is known as-

  1. Transaction
  2. Commit
  3. Rollback
  4. Control

Answer: A) Transaction

Explanation:

A single unit of work for all commands executed consecutively is known as Transaction.

Discuss this Question


9. To get the table's previous permanent status, use the ____ command.

  1. Commit
  2. Transaction
  3. Rollback
  4. None of the above

Answer: C) Rollback

Explanation:

To get the table's previous permanent status, use the rollback command.

Discuss this Question


10. In order to start the transaction, the command used is –

  1. Mysql > START COMMIT;
  2. Mysql > START TRANSACTION;
  3. Mysql > START ROLLBACK;
  4. None of the above

Answer: B) Mysql > START TRANSACTION;

Explanation:

To start the transaction, Mysql > START ROLLBACK; command is used.

Discuss this Question





Comments and Discussions!

Load comments ↻





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