some more work done on sql side
first sql to model to view working