Bird
0
0

Which of the following is TRUE about aliasing a subquery in the FROM clause?

easy📝 Conceptual Q2 of 15
PostgreSQL - Subqueries in PostgreSQL
Which of the following is TRUE about aliasing a subquery in the FROM clause?
AAlias is mandatory to reference the subquery result
BAlias can only be a number
CAlias must be the same as the original table name
DAlias is optional and can be omitted
Step-by-Step Solution
Solution:
  1. Step 1: Check alias requirement for subqueries in FROM

    PostgreSQL requires an alias for subqueries in the FROM clause to reference their columns.
  2. Step 2: Understand alias rules

    The alias can be any valid identifier but is mandatory to avoid syntax errors.
  3. Final Answer:

    Alias is mandatory to reference the subquery result -> Option A
  4. Quick Check:

    Subquery alias = Mandatory [OK]
Quick Trick: Always give an alias to subqueries in FROM clause [OK]
Common Mistakes:
  • Omitting alias causing syntax errors
  • Using invalid alias names
  • Assuming alias is optional

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PostgreSQL Quizzes