Accenture interview question

Write a sql query to join the table