Complete the code to create a B-tree index on the column 'username' in the 'users' table.
CREATE INDEX idx_username ON users ([1]);The B-tree index is created on the 'username' column to speed up queries filtering by username.
Complete the code to create a B-tree index that sorts the 'created_at' column in descending order.
CREATE INDEX idx_created_desc ON orders ([1] DESC);The index is created on 'created_at' column with descending order to optimize queries sorting by newest orders first.
Fix the error in the index creation statement to use the default B-tree index on the 'email' column.
CREATE INDEX idx_email ON customers ([1]);Using just the column name 'email' creates a default B-tree index with ascending order and default NULLS placement.
Fill both blanks to create a B-tree index on 'last_name' and 'first_name' columns for sorting by last name ascending and first name descending.
CREATE INDEX idx_name ON employees ([1] ASC, [2] DESC);
The index sorts by 'last_name' ascending and 'first_name' descending to optimize queries ordering by full name.
Fill all three blanks to create a B-tree index on 'category', 'price' ascending, and 'stock' descending columns.
CREATE INDEX idx_product ON products ([1], [2] ASC, [3] DESC);
This index helps queries filtering by category and sorting by price ascending and stock descending.