Given such data
UserID, MovieType , year
1, 2, 2000
1, 3, 2000
1, 2, 2006
2, 3, 2010
2, 4, 2011
2, 3, 2002
1, 2, 2010
What are the best option to store it in java , such that I can sort it according to first column , then second column then third ?
UserID, MovieType , year
1, 2, 2000
1, 2, 2006
1, 2, 2010
1, 3, 2000
2, 3, 2002
2, 3, 2010
2, 4, 2011
And then group them by user ID and Movietype
UserID, MovieType , movies seen per year
1, 2, 3
1, 3, 1
2, 3, 2
2, 4, 1