JK Tech Interview Question

Asked to write couple sql queries.