Pergunta de entrevista da empresa Tata Consultancy Services

1 SQL query( left join), a pattern printing problem