ITWorx interview question

some sql queries