Detect SQL injection patterns
Your task
Implement a heuristic SQL-injection detector for a web application firewall. Given a query string (raw user input), return True if it contains any of these suspicious patterns (case-insensitive): a tautology like ' OR '1'='1 (an apostrophe, optional whitespace, 'or', whitespace, optional apostrophe, '1', optional apostrophe, optional whitespace, '=', optional whitespace, optional apostrophe, '1'); a '; DROP TABLE' statement; a SQL comment '--'; or a 'UNION SELECT' clause (with whitespace between). Otherwise return False. This is a heuristic, not a parser.
Examples
detect_sqli(query: str) -> boolExample 1
Input
detect_sqli("admin' OR '1'='1")Output
True