Question
Consider a query where there is a many to one relationship, for example students, and the listing of courses they have taken over several semesters.
Consider a query where there is a many to one relationship, for example students, and the listing of courses they have taken over several semesters. You are asked to show each student and courses they have taken most recently. (Check all that apply.)
a.Use a correlated sub-query to solve the question where the correlated sub-query selects data from the course enrollment table, and the outer query from the student table.
b.Join the student and the student enrollment table, then create an aggregate on it with a having filter on the date course attended.
c.Create an inline view or a CTE comprised of a join of both the student and the course enrollment table, and use a window function to determine a row number of each record with a sort condition on the enrollment dates. Use the outer query to filter on the row number.
d.The simplest way to solve this problem, is to simply use a PIVOT command with a sub-query combination.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started