A subquery or inner query is a SELECT query nested inside another SQL query called as outer query. The outer query can be a SELECT, INSERT, UPDATE, DELETE, SET statements or inside another subquery.
In PostgreSQL, inline view subqueries must have an alias. If alias is not present PG, throws error.