Junior — Senior
How to determine which queries use a composite index
livecode
Task condition
Question: Which of the listed queries can utilize the created composite index?
CREATE INDEX IDX_Composite ON MyTable (Col1, Col2);
1. SELECT * FROM MyTable WHERE Col1 = 1;
2. SELECT * FROM MyTable WHERE Col2 = 2;
3. SELECT * FROM MyTable WHERE Col1 = 1 AND Col2 = 2;
4. SELECT * FROM MyTable WHERE Col2 = 2 AND Col1 = 1;
Analyze each query and indicate whether it uses the specified index.