0
0
SQLquery~10 mins

CREATE INDEX syntax in SQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create an index named idx_name on the column col1 of the table my_table.

SQL
CREATE INDEX [1] ON my_table (col1);
Drag options to blanks, or click blank then click option'
Atable_index
Bmy_index
Cindex1
Didx_name
Attempts:
3 left
💡 Hint
Common Mistakes
Using the table name instead of the index name.
Omitting the index name.
Using a column name as the index name.
2fill in blank
medium

Complete the code to create a unique index named unique_idx on the column email of the table users.

SQL
CREATE [1] INDEX unique_idx ON users (email);
Drag options to blanks, or click blank then click option'
AUNIQUE
BTEMPORARY
CFULLTEXT
DCLUSTERED
Attempts:
3 left
💡 Hint
Common Mistakes
Using TEMPORARY which is for temporary tables, not indexes.
Using FULLTEXT which is for text search indexes.
Using CLUSTERED which is not standard SQL syntax.
3fill in blank
hard

Fix the error in the code to create an index named idx_age on the age column of the table persons.

SQL
CREATE INDEX idx_age [1] persons (age);
Drag options to blanks, or click blank then click option'
AON
BIN
CFOR
DTO
Attempts:
3 left
💡 Hint
Common Mistakes
Using IN or FOR which are not valid here.
Omitting the keyword ON.
4fill in blank
hard

Fill both blanks to create a unique index named idx_unique on the columns col1 and col2 of the table data_table.

SQL
CREATE [1] INDEX idx_unique [2] data_table (col1, col2);
Drag options to blanks, or click blank then click option'
AUNIQUE
BTEMPORARY
CON
DIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using TEMPORARY instead of UNIQUE.
Using IN instead of ON.
5fill in blank
hard

Fill all three blanks to create a fulltext index named idx_fulltext on the column description of the table products.

SQL
CREATE [1] INDEX [2] [3] products (description);
Drag options to blanks, or click blank then click option'
AFULLTEXT
Bidx_fulltext
CON
DUNIQUE
Attempts:
3 left
💡 Hint
Common Mistakes
Using UNIQUE instead of FULLTEXT.
Omitting the ON keyword.
Swapping the order of index name and index type.