Table:
0
A
B
C
D
1
student id
course id
date of attendance
student course attendance
2
111
301
2008-11-04 10:35:13
3
121
301
2012-04-09 11:44:34
4
121
303
2014-04-09 11:44:34
5
141
302
2013-04-09 11:44:34
6
171
301
2015-04-09 11:44:34
7
161
302
2014-01-09 11:44:34
8
151
305
2012-05-09 11:44:34
9
141
301
2012-09-09 11:44:34

Questions and formulas:
Question: What are the student ids and course ids?
Formula: UNIQUE(HSTACK(A1,B1))
Formula2: UNIQUE(HSTACK(A2:A9,B2:B9))
Level: easy
Question: Students who attended at least one course.
Formula: LET(query1,SUMMARIZE(A1,SUMX(B1)),FILTER(query1,CHOOSECOLS(query1,3)>=1))
Formula2: LET(query1,SUMMARIZE(A2:A9,SUMX(B2:B9)),FILTER(query1,CHOOSECOLS(query1,3)>=1))
Level: hard
Question: the id of student who attends course 301
Formula: UNIQUE(CHOOSECOLS(FILTER(A1:D1,B1=301),1))
Formula2: UNIQUE(CHOOSECOLS(FILTER(A2:D9,B2:B9=301),1))
Level: medium
Question: Ids of students who attended 301 course.
Formula: LET(query1,SUMMARIZE(A1,SUMX(B1)),FILTER(query1,CHOOSECOLS(query1,3)=301))
Formula2: LET(query1,SUMMARIZE(A2:A9,SUMX(B2:B9)),FILTER(query1,CHOOSECOLS(query1,3)=301))
Level: hard