Try generalizing the SQL queries