Updated sql
Merge pull request #4 from martindido/improvements/models

Updated sql