CCS Global Tech interview question

Sql queries