0
0
SQLquery~10 mins

Single column index 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 a single column index on the 'name' column of the 'employees' table.

SQL
CREATE INDEX [1] ON employees(name);
Drag options to blanks, or click blank then click option'
Aname_index
Bindex_name
Cidx_name
Didx_employees
Attempts:
3 left
💡 Hint
Common Mistakes
Using reserved keywords as index names.
Omitting the index name entirely.
2fill in blank
medium

Complete the code to create a unique single column index on the 'email' column of the 'users' table.

SQL
CREATE [1] INDEX idx_email ON users(email);
Drag options to blanks, or click blank then click option'
AUNIQUE
BFOREIGN
CPRIMARY
DFULLTEXT
Attempts:
3 left
💡 Hint
Common Mistakes
Using PRIMARY instead of UNIQUE for a unique index.
Confusing FULLTEXT with UNIQUE.
3fill in blank
hard

Fix the error in the code to create an index on the 'date' column of the 'orders' table.

SQL
CREATE INDEX idx_date ON orders([1]);
Drag options to blanks, or click blank then click option'
Adate
BorderDate
Cdates
Dorder_date
Attempts:
3 left
💡 Hint
Common Mistakes
Using a plural form of the column name.
Using a different column name that does not exist.
4fill in blank
hard

Fill both blanks to create a unique index named 'idx_user_id' on the 'user_id' column of the 'sessions' table.

SQL
CREATE [1] INDEX [2] ON sessions(user_id);
Drag options to blanks, or click blank then click option'
AUNIQUE
Bidx_sessions
Cidx_user_id
DINDEX
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-unique keyword for a unique index.
Using a wrong index name.
5fill in blank
hard

Fill all three blanks to create a single column index named 'idx_product_code' on the 'code' column of the 'products' table with the index type 'BTREE'.

SQL
CREATE [1] INDEX [2] ON products([3]) USING BTREE;
Drag options to blanks, or click blank then click option'
AINDEX
Bidx_product_code
Ccode
DUNIQUE
Attempts:
3 left
💡 Hint
Common Mistakes
Using UNIQUE instead of INDEX for a normal index.
Using wrong column or index names.