Complete the code to create an expression index on the lower case of the column 'name'.
CREATE INDEX idx_lower_name ON users ([1]);The expression index uses LOWER(name) to index the lowercase version of the 'name' column.
Complete the code to create an expression index on the first 10 characters of the 'email' column.
CREATE INDEX idx_email_prefix ON users ([1]);The expression index uses SUBSTRING(email FROM 1 FOR 10) to index the first 10 characters of the 'email' column.
Fix the error in the expression index creation by completing the code correctly.
CREATE INDEX idx_trim_name ON users ([1]);The correct syntax for trimming spaces is TRIM(name). Options A, B, and D are invalid syntax. Option D is invalid because TRIM in PostgreSQL does not take two arguments like that.
Fill both blanks to create an expression index on the lower case of the first 5 characters of 'username'.
CREATE INDEX idx_lower_prefix ON users ([1]([2](username, 1, 5)));
The expression index applies LOWER to the SUBSTRING of 'username'. The correct order is LOWER(SUBSTRING(username, 1, 5)).
Fill all three blanks to create an expression index on the trimmed, lowercased 'city' column.
CREATE INDEX idx_trim_lower_city ON locations ([1]([2]([3])));
The expression index applies LOWER to TRIM applied to the 'city' column: LOWER(TRIM(city)).