Tutorial: Indexes In Oracle
Same applies in databases too. An index is used to avoid wastage of time that is spent in searching for a particular record in a table.
For example, consider the following table

If you run the following query on this table:
select * from emp where empno=7844;
it will go and scan each and every block of data starting from the top row till bottom row and when it finds empno 6844, it gives the result. This is a small table, consider the same operation on a table with 10 million rows, it will definitely consume a lot of time. This can be reduced by using index. An index can be created as follows:
create index ind_1 on emp(empno);
In the above statement, we are telling oracle to create an index named ind_1 on empno filed of table emp.
When this index is created, one more table is formed in the back end that stores the address of each and every row. Following diagram will give a clean idea about it:

As shown in the diagram, every empno has a corresponding address which holds the address of each row of the emp table. Now whenever we want to extract row corresponding to a particular empno, we get the row very fastly compared to earlier method where we had no index.
This is how indexes are helpful in databases..
There are mainly four type of indexes which I will be discussing further in the comments.
They are:
--> B-Tree Index
--> Reverse B-Tree Index
--> Bitmap index
--> Function based Index
--Nick