今天面试一道关于SQL查询题,求解答!

具体问题如下图

兄弟怎么一道题发了两遍啊
[code="sql"]select a.id,a.name,b.type,(case when exists a.id=b.id then 'Y' else 'N') from a left join b on a.id=b.id;[/code]