Python Check String For Substring In Sql