Complete the code to create a single column index on the 'name' column of the 'employees' table.
CREATE INDEX [1] ON employees(name);The index name can be any valid identifier. Here, idx_name is a common naming style for indexes on the 'name' column.
Complete the code to create a unique single column index on the 'email' column of the 'users' table.
CREATE [1] INDEX idx_email ON users(email);The UNIQUE keyword ensures that all values in the 'email' column are distinct.
Fix the error in the code to create an index on the 'date' column of the 'orders' table.
CREATE INDEX idx_date ON orders([1]);The column name must exactly match the existing column in the table. Here, the column is named date.
Fill both blanks to create a unique index named 'idx_user_id' on the 'user_id' column of the 'sessions' table.
CREATE [1] INDEX [2] ON sessions(user_id);
The UNIQUE keyword creates a unique index, and the index name should be idx_user_id as specified.
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'.
CREATE [1] INDEX [2] ON products([3]) USING BTREE;
The keyword INDEX creates a normal index, the name is idx_product_code, and the column is code. The USING BTREE specifies the index type.