0 votes
1 view
in SQL by (30.7k points)

Can anyone tell me how to create index in SQL?

1 Answer

0 votes
by (72.4k points)

Indexes are created to retrieve the data from the database quickly.  We can use CREATE INDEX statement to create indexes in SQL. Here is the syntax to create an index on the table:

CREATE INDEX index_name
ON table_name (column_1, column_2, ...);

If you want to create a unique index on a table, here is the syntax for that:

CREATE UNIQUE INDEX index_name
ON table_name (column_1, column_2, ...);

I recommend this SQL Course by Intellipaat to learn SQL and writing complex SQL queries.

Related questions

0 votes
1 answer
0 votes
1 answer
asked May 8 in SQL by Sudhir_1997 (30.7k points)
0 votes
1 answer
asked May 5 in SQL by Sudhir_1997 (30.7k points)
0 votes
1 answer
asked Apr 22 in SQL by Sudhir_1997 (30.7k points)
0 votes
1 answer
asked Apr 20 in SQL by Sudhir_1997 (30.7k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...