The ________ keyword is used to access attributes of preceding tables or subqueries in the from clause.
Subject: Database Systems
Topic: SQL & Query Languages
Options:
- Option A: In
- Option B: Lateral
- Option C: Having
- Option D: With
Correct Answer:
Option B: Lateral
Explanation:
Eg : SELECT name, salary, avg salary FROM instructor I1, lateral (SELECT avg(salary) AS avg salary FROM instructor I2 WHERE I2.dept name= I1.dept name); Without the lateral clause, the subquery cannot access the correlation variable I1 from the outer query.