Indexes are used to quickly locate data without having to search every row in the database table each time a database table is accessed.
Indexes can be created using one or more columns of a database table, providing the basis for both rapid or random lookup and efficient access of ordered records.
Index is a data structure that improves the speed of data retrieval operations on a database table.
How to create index:
create index <index_name> on <table_name> (<col1>,<col2>,...);
So, if you want to create index on color column on your paint table and call it paint_color_i, SQL would look like below:
create index paint_color_i on paint (color);
You can also include more column to index like below:
create index paint_color_i on paint (color,type);