Allscripts interview question

Question related to SQL