Design index for prefix search
SQL
Hard
2 views
Problem Description
Customers are searched by name starting with 'ra'. Write an index and a matching query.
Input Format
SQL DDL + query
Output Format
DDL + result set
Constraints
Use LIKE 'ra%'
Official Solution
CREATE INDEX idx_customers_name ON Customers(name); SELECT customer_id, name FROM Customers WHERE name LIKE 'ra%';
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!