Postgresql Select Data From Another Sql Interview Query Question