Python Check If Substring Exists In Sql