Data Tweening: Pivot

Meraj Khan, Larry Xu, Arnab Nandi, Joseph M. Hellerstein[source]

Let's say we have a table of student records. From that information, we want to find the average grade per course per year.

Student IDLast NameYear of EnrollmentCourseGPA
1Johnson2012CSE3.47
4Hayes2012CSE3.82
2Turner2012ECE3.34
3Jones2012ECE3.54
5Lindsay2012ECE2.99
6Smith2013CSE3.12
10Frick2013CSE3.53
11Jones2013CSE3.78
12Zelaya2013CSE3.94
7Wallace2013ECE4.00
8Jabbar2013ECE3.65
9Borg2013ECE3.32