2.10.sql 454 Bytes
Newer Older
Matias Ferreira committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/*2.10. Hacer un query que liste los alumnos que van a cursar el curso de código a2020 con 25 años.*/

SELECT fullname
FROM
(
  (
    enrollments en
      LEFT JOIN
        courses co
    ON en.course_iid = co.course_iid
  )
  AS en_join_co
    LEFT JOIN
      students st
  ON en_join_co.student_iid = st.student_iid
)
AS en_j_co_j_st
WHERE  EXTRACT('year' FROM age(CURRENT_DATE, en_j_co_j_st.birth_date)) >= 25
    AND
  en_j_co_j_st.code = 'a2020';