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

Can anyone tell me how to create index in SQL?

1 Answer

0 votes
by (119k 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
0 votes
1 answer
0 votes
1 answer
asked Jan 16, 2020 in SQL by anmolj (9k points)
0 votes
1 answer
asked Jul 4, 2019 in SQL by Tech4ever (20.3k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...