EPAM Systems Interview Question

SQL question medium level was asked