Python Check If Substring Exists Sql