ADVERTISEMENT
ADVERTISEMENT

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?

  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.


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.

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.


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.


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.


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 '%' & '_'.


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.


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.


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.


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.


ADVERTISEMENT
ADVERTISEMENT


Comments and Discussions!



ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.