In a relational database management system, what is an index and which SQL statement shows the basic syntax to create a simple non-unique index on a single column?

Difficulty: Easy

Correct Answer: An index is a logical pointer structure that speeds up row retrieval, created with CREATE INDEX index_name ON table_name(column_name);

Explanation:


Introduction / Context:
In relational database management systems such as Oracle, MySQL, SQL Server, and PostgreSQL, indexes are one of the most important physical design features for improving query performance. This question checks whether you understand what an index really is and if you can recognize the basic SQL syntax for creating a simple non unique index on a single column. Many beginners confuse indexes with backups, views, or logs, so clarifying this concept is very valuable for interviews and exam preparation.


Given Data / Assumptions:

  • We are working with a relational database management system.
  • We want to improve the speed of data retrieval for queries on a specific column.
  • We are looking at the basic syntax for creating a non unique index on one column.
  • We assume a generic table_name and column_name as placeholders.


Concept / Approach:
An index in a database is similar to an index in a book. Instead of scanning every row in a table, the database can use an ordered structure that maps key values to the physical locations of rows. This structure is usually implemented as a B tree or similar data structure. The core idea is to trade extra storage and some overhead on insert, update, and delete operations in exchange for much faster select queries. To create such a structure, SQL provides the CREATE INDEX statement. The simplest form specifies the index name, the table name, and the column or columns that will be indexed.


Step-by-Step Solution:
Step 1: Recall that an index is not a backup or a log but a separate data structure used to speed up retrieval of rows based on search predicates. Step 2: Remember the simplest syntax for index creation: CREATE INDEX index_name ON table_name(column_name); Step 3: Evaluate each option and check whether it both defines the index correctly and uses the correct SQL syntax. Step 4: Option B correctly describes an index as a logical pointer structure and shows the correct CREATE INDEX syntax. Step 5: The other options either misdefine what an index is or use invalid SQL statements, so they must be rejected.


Verification / Alternative check:
A simple way to verify the correct answer is to think about what happens when you run an explain plan for a query that uses a where clause on an indexed column. The query plan will often show an index range scan or index unique scan, which confirms that the database is using a separate index structure. You can also check your database documentation, where the basic syntax example for index creation is always very close to CREATE INDEX index_name ON table_name(column_name). Any syntax that uses words like BACKUP INDEX, CREATE VIEW for index creation, or that describes the index as a transaction log is not correct.


Why Other Options Are Wrong:

  • Option A is wrong because an index is not a backup and there is no BACKUP INDEX syntax in standard SQL.
  • Option C is wrong because a view is a stored query, not an index, and CREATE VIEW does not create an index structure.
  • Option D is wrong because a transaction log is different from an index and it is not created with an explicit SQL statement like this.
  • Option E is wrong because an index is not a trigger and there is no CREATE INDEX TRIGGER syntax in standard SQL.


Common Pitfalls:
A common mistake is to think that indexes are the same as primary keys or constraints. While primary keys often create indexes internally, the concepts are not identical. Another pitfall is to assume that indexes automatically appear without explicit creation, which is only true for some constraints such as primary keys and unique constraints. Learners sometimes confuse indexes with views, materialized views, or backup files. It is also important to remember that excessive or poorly designed indexing can slow down write operations and increase storage usage, so indexes must be planned carefully.



Final Answer:
The correct definition and syntax are given in Option B: An index is a logical pointer structure that speeds up row retrieval, created with CREATE INDEX index_name ON table_name(column_name);


Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion