Modified sql-queries
Merge branch 'next'