Allscripts Interview Question

Sql complex queries