Complete the code to create a simple index on the column 'name' in 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.
Complete the code to create a unique index on the 'email' column in the 'users' table.
CREATE [1] INDEX idx_email ON users(email);The UNIQUE keyword ensures that all values in the 'email' column are unique.
Fix the error in the code to create an index on the 'created_at' column in the 'orders' table.
CREATE INDEX idx_created_at ON orders([1]);The column name must match exactly as defined in the table. Here, created_at is the correct column name.
Fill both blanks to create a composite index on 'last_name' and 'first_name' columns in the 'contacts' table.
CREATE INDEX [1] ON contacts([2], first_name);
The index name idx_last_first clearly indicates the columns indexed. The first column in the index must be last_name.
Fill all three blanks to create a fulltext index named 'idx_content' on the 'title' and 'body' columns in the 'articles' table.
CREATE [1] INDEX [2] ON articles([3], body);
The FULLTEXT keyword creates a full-text index. The index is named idx_content and covers the columns title and body.