Home »
SQL »
SQL MCQs
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
1. Which of the following is TRUE about SQL Auto Increment?
- It increments the unique number automatically.
- It decrements the unique number automatically.
- It keeps the unique number constant
- None of the above
Answer: A) It increments the unique number automatically
Explanation:
SQL Auto Increment increments the unique number automatically.
2. Which of the following is the feature(s) of SQL Auto Increment?
- In some cases you may not have any unique identifying characteristics in data; therefore, it makes sense to create a Primary Key.
- Explicitly initializing and modifying the auto-increment value is possible at any time.
- Record identifiers can easily be created that are unique to each record.
- All of the above
Answer: D) All of the above
Explanation:
Features of SQL Auto Increment are:
- In some cases you may not have any unique identifying characteristics in data; therefore, it makes sense to create a Primary Key.
- Explicitly initializing and modifying the auto-increment value is possible at any time.
- Record identifiers can easily be created that are unique to each record.
- Automatic incrementing allows flexibility in handling gaps between records.
- Syntax-speaking, auto-increment queries in SQL are straightforward.
3. Which keyword is used in SQL Server to implement the auto increment?
- UNIQUE
- IDENTITY
- INCREMENT
- ADD
Answer: B) IDENTITY
Explanation:
IDENTITY keyword is used in SQL Server to implement the auto-increment.
4. In SQL, Like is a __________operator.
- Relational
- Logical
- Additional
- Unique
Answer: B) Logical
Explanation:
In SQL, LIKE is an Additional operator.
5. SQL Like is NOT used with which of the following statement(s)?
- DELETE
- SELECT
- UPDATE
- ALTER
Answer: D) ALTER
Explanation:
SQL LIKE is used with DELETE, SELECT and UPDATE statements and not with ALTER statements.
6. The character(s) which are used independently or in conjunction with SQL Like Operator:
- %
- _
- Both A. and B.
- 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 '%' & '_'.
7. Which of the following is/are transaction control commands in SQL?
- Commit
- Rollback
- Both A. and B.
- None of the above
Answer: C) Both A. and B.
Explanation:
Commit and Rollback are transaction control commands in SQL.
8. A single unit of work for all commands executed consecutively is known as-
- Transaction
- Commit
- Rollback
- Control
Answer: A) Transaction
Explanation:
A single unit of work for all commands executed consecutively is known as Transaction.
9. To get the table's previous permanent status, use the ____ command.
- Commit
- Transaction
- Rollback
- None of the above
Answer: C) Rollback
Explanation:
To get the table's previous permanent status, use the rollback command.
10. In order to start the transaction, the command used is –
- Mysql > START COMMIT;
- Mysql > START TRANSACTION;
- Mysql > START ROLLBACK;
- None of the above
Answer: B) Mysql > START TRANSACTION;
Explanation:
To start the transaction, Mysql > START ROLLBACK; command is used.