๐ Using Indexes in Oracle SQL to Improve Query Performance

As part of my continued learning with Oracle Autonomous Database, I explored how indexes can improve query performance in SQL. Indexes help databases retrieve data faster, especially when working with large datasets.
๐ฏ Objective
The goal of this activity was to:
Understand what indexes are
Learn how to create an index
Improve query performance
๐ป Step 1: Creating the Table
CREATE TABLE employees (
emp_id NUMBER,
emp_name VARCHAR2(50),
department VARCHAR2(50),
salary NUMBER
);
๐งช Step 2: Inserting Data
INSERT INTO employees VALUES (1, 'Ali', 'IT', 50000);
INSERT INTO employees VALUES (2, 'Ahmed', 'HR', 70000);
INSERT INTO employees VALUES (3, 'Sara', 'IT', 60000);
INSERT INTO employees VALUES (4, 'Zara', 'HR', 65000);
โก Step 3: Creating an Index
CREATE INDEX idx_salary ON employees(salary);
This index helps speed up queries that filter by salary.
๐ Step 4: Querying Data
SELECT * FROM employees WHERE salary > 60000;๐ก What I Learned
What indexes are and why they are useful
How to create an index in Oracle SQL
Improving query performance
๐ Conclusion
This activity helped me understand how indexes optimize database queries. Indexes are an essential concept in database performance tuning and are widely used in real-world applications.





