Thomson Reuters Interview Question

logical questions on sql