Sample Exam Questions
※This sample exam is different from those that appear in the actual OSS-DB Exam.
2024/05/01
Indexes are created to optimize data retrieval, but they can be automatically created based on constraints applied to tables or columns. This happens when a uniqueness constraint is applied to a column (or a combination of columns). Without an index, when adding new data to a table, you would need to perform a full search to check if data with the same key value exists in that column. With an index, you can simply search the index to verify the existence of the data, which is much more efficient. Therefore, when a UNIQUE constraint or a PRIMARY KEY constraint is applied to a column (or a combination of columns), an index is automatically created on that column.
FOREIGN KEY or REFERENCES is a constraint that there is data with the same key value in another table. The key column on the referenced side must be UNIQUE, so an index exists, but the referencing side does not need to be UNIQUE, so automatic index creation is not performed. Note that if you update or delete the key column on the referenced side, there is a risk of data inconsistency where the referenced destination does not exist, so restrictions are placed on updates and deletions. In cases where such updates and deletions are made, it is desirable to also create an index on the referencing side to efficiently check whether each key is actually being referenced and from which data.
A NOT NULL constraint simply checks that each piece of data is not NULL, so an index is not automatically created.
Therefore, the correct answers are C and E.
© EDUCO All Rights Reserved.