Allscripts interview question

Related to sql