added sql and correct some mistakes
added sql and correct some mistakes
updated models
updated models