Examples
Input: ([["CREATE", "TABLE", "students", "(", "id", "age", "score", ")"], ["INSERT", "INTO", "students", "(", "1", "20", "90", ")"], ["INSERT", "INTO", "students", "(", "2", "19", "95", ")"], ["INSERT", "INTO", "students", "(", "3", "20", "88", ")"], ["SELECT", "FROM", "students", "WHERE", "(", "age", "=", "20", "AND", "score", ">", "88", ")"], ["SELECT", "FROM", "students", "WHERE", "(", "age", "=", "20", "AND", "score", ">=", "88", ")"]],)
Expected Output: [[[1, 20, 90]], [[1, 20, 90], [3, 20, 88]]]
Explanation: The first SELECT matches only the row with score > 88. The second matches both rows where age is 20 and score is at least 88.
Input: ([["CREATE", "TABLE", "t", "(", "a", "b", ")"], ["INSERT", "INTO", "t", "(", "5", "6", ")"], ["INSERT", "INTO", "missing", "(", "1", "2", ")"], ["SELECT", "FROM", "t", "WHERE", "(", "a", "=", "5", "AND", "b", "=", "6", ")"], ["SELECT", "FROM", "t", "WHERE", "(", "c", "=", "1", ")"]],)
Expected Output: [[[5, 6]], []]
Explanation: The insert into a missing table is ignored. The second SELECT references a missing column, so it returns an empty list.
Input: ([["CREATE", "TABLE", "nums", "(", "x", "y", ")"], ["INSERT", "INTO", "nums", "(", "-1", "-1", ")"], ["INSERT", "INTO", "nums", "(", "-1", "2", ")"], ["INSERT", "INTO", "nums", "(", "3", "-1", ")"], ["SELECT", "FROM", "nums", "WHERE", "(", "x", "=", "-1", ")"]],)
Expected Output: [[[-1, -1], [-1, 2]]]
Explanation: Negative integers are valid stored values. The SELECT returns every row whose x value is -1.
Input: ([["CREATE", "TABLE", "items", "(", "id", ")"], ["CREATE", "TABLE", "items", "(", "other", ")"], ["INSERT", "INTO", "items", "(", "abc", ")"], ["INSERT", "INTO", "items", "(", ")"], ["INSERT", "INTO", "items", "(", "7", ")"], ["SELECT", "FROM", "items", "WHERE", "(", "id", ">=", "7", ")"], ["SELECT", "FROM", "missing", "WHERE", "(", "id", "=", "7", ")"]],)
Expected Output: [[[7]], []]
Explanation: The duplicate CREATE is ignored. Invalid INSERT queries are ignored. Only the valid row [7] is stored, and selecting from a missing table returns an empty list.