Given this table where each class is delimited by a pipe:
Jack Algebra 1|Spanish|Literature
Jill AP Calc| Spanish 2| History| Anatomy
James Study Hall
Jill Study Hall
Jill AP Calc
I need to find the total number of classes each student has and the total number of distinct permutations. It is NOT guaranteed that a row is distinct or that a class will not appear in another row for the same student.
Jill would have a total of 5 classes (AP Calc, Spanish 2, History, Anatomy, and Study Hall)
Total Student to Class Permutations: 9
Two separate SQL queries would be fine.