Classify Data Using Sql With Python