SQL Indexes & Transactions Quiz

Last Updated :
Discuss
Comments

Question 1

What is an index in SQL?

  • A

    A data structure that stores values in sorted order for fast retrieval

  • B

    A temporary table used for intermediate data processing

  • C

    A constraint that ensures data integrity

  • D

    A function that calculates aggregate values

Question 2

Which SQL statement is used to create an index?

  • A

    CREATE INDEX

  • B

    ADD INDEX

  • C

    INDEX TABLE

  • D

    SET INDEX

Question 3

What is the purpose of an index in SQL?

  • A

    To enforce data integrity constraints

  • B

    To store intermediate query results

  • C

    To improve the speed of data retrieval operations

  • D

    To perform calculations on aggregate data

Question 4

Which type of index is automatically created by the database management system to enforce the PRIMARY KEY constraint?

  • A

    Clustered index

  • B

    Non-clustered index

  • C

    Unique index

  • D

    Composite index

Question 5

What is a transaction in SQL?

  • A

    A set of operations that are executed as a single unit of work

  • B

    A temporary storage area used for intermediate data processing

  • C

    A constraint that ensures data integrity

  • D

    A function that calculates aggregate values

Question 6

Which SQL statement is used to begin a transaction?

  • A

    BEGIN TRANSACTION

  • B

    START TRANSACTION

  • C

    INITIATE TRANSACTION

  • D

    TRANSACTION BEGIN

Question 7

What is the purpose of a rollback in SQL?

  • A

    To commit the changes made by a transaction

  • B

    To save the changes made by a transaction

  • C

    To undo the changes made by a transaction

  • D

    To finalize the changes made by a transaction

Question 8

Which SQL statement is used to commit a transaction?

  • A

    COMMIT

  • B

    END TRANSACTION

  • C

    SAVE TRANSACTION

  • D

    FINALIZE TRANSACTION

Question 9

What is the purpose of a savepoint in SQL transactions?

  • A

    To rollback the entire transaction

  • B

    To mark a point within a transaction to which you can later roll back

  • C

    To commit the changes made by a transaction

  • D

    To finalize the changes made by a transaction

Question 10

Which type of index does not alter the physical order of the table's rows and is typically faster to update than a clustered index?

  • A

    Clustered index

  • B

    Non-clustered index

  • C

    Unique index

  • D

    Composite index

There are 10 questions to complete.

Take a part in the ongoing discussion