Final answer:
The correct answer is d) FILTER (students, i -> i.total_courses < 3). In this query, the FILTER function is used to select the students who are enrolled in less than 3 courses.
Step-by-step explanation:
The correct answer is d) FILTER (students, i -> i.total_courses < 3).
In this query, we want to select the faculty_id and students columns from the faculties table and also a new column called few_courses_students, which represents the students who are enrolled in less than 3 courses.
To accomplish this, we can use the FILTER function to filter the students based on a condition. In this case, the condition is i.total_courses < 3, which checks if the total_courses value of the student is less than 3.
Here is an example of how the query would look like:
SELECT faculty_id, students, FILTER (students, i -> i.total_courses < 3) AS few_courses_students FROM faculties;