Excellon Software interview question

Sql queries