0
0
DBMS Theoryknowledge~20 mins

Primary vs secondary indexes in DBMS Theory - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Index Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Difference in uniqueness between primary and secondary indexes

Which statement correctly describes the uniqueness property of primary and secondary indexes in a database?

ANeither primary nor secondary indexes enforce uniqueness on their indexed columns.
BSecondary indexes enforce uniqueness on the indexed column, while primary indexes do not necessarily enforce uniqueness.
CBoth primary and secondary indexes always enforce uniqueness on their indexed columns.
DPrimary indexes enforce uniqueness on the indexed column, while secondary indexes do not necessarily enforce uniqueness.
Attempts:
2 left
💡 Hint

Think about the role of a primary key in a table.

📋 Factual
intermediate
2:00remaining
Storage location of primary vs secondary indexes

Where are primary and secondary indexes typically stored in relation to the data in a database?

ABoth primary and secondary indexes store data sorted with the table rows.
BSecondary indexes store data sorted with the table rows; primary indexes store pointers to the data rows separately.
CPrimary indexes store data sorted with the table rows; secondary indexes store pointers to the data rows separately.
DBoth primary and secondary indexes store pointers to data rows separately.
Attempts:
2 left
💡 Hint

Consider how clustered and non-clustered indexes work.

🚀 Application
advanced
2:00remaining
Choosing index type for query optimization

You have a table with millions of records and frequent queries filtering by a non-unique column. Which index type should you create to improve query speed without affecting data uniqueness?

ACreate a secondary index on the non-unique column.
BCreate a primary index on the non-unique column.
CCreate a primary index on a unique column and no secondary index.
DCreate no index to avoid overhead.
Attempts:
2 left
💡 Hint

Primary indexes require uniqueness; think about which index supports non-unique columns.

🔍 Analysis
advanced
2:00remaining
Impact of primary vs secondary indexes on insert performance

How does having a primary index compared to multiple secondary indexes affect the performance of inserting new records into a database table?

ASecondary indexes slow down inserts more than primary indexes because each index must be updated separately.
BIndexes do not affect insert performance.
CPrimary and secondary indexes have the same impact on insert performance.
DPrimary indexes slow down inserts more than secondary indexes because they require data sorting.
Attempts:
2 left
💡 Hint

Consider how many indexes need updating when inserting a new row.

Reasoning
expert
2:00remaining
Why secondary indexes can cause inconsistent query results if not maintained properly

In a database system, if secondary indexes are not updated correctly after data changes, what kind of problem can occur when querying using those indexes?

AQueries will always fail with a syntax error due to index corruption.
BQueries may return outdated or incorrect results because the secondary index points to wrong or missing data rows.
CQueries will ignore the secondary index and always perform full table scans.
DQueries will return duplicate rows because secondary indexes enforce uniqueness incorrectly.
Attempts:
2 left
💡 Hint

Think about what happens if an index points to data that no longer exists or has changed.