Python Array Check If Value Exists In Table Sql