Im new at SQL and trying to create a basic subquery. I need to find the difference between the avg age in Manager and avg age in Trainee.
Title is one column- Manager or Trainee Age is one column, all within the same table.
Would i use two subqueries to do something like:
Select manager_age - trainee_age
from book1
(select avg(age) as manager_age from book1 where title = "manager")
and another subquery:
(select avg(age) as manager_age from book1 where title = "trainee")
Im not sure how to do two subqueries in one query or if I should do this another way like a join? Thank you!