Populate sheet by filtering another sheet

I have two sheets. The first sheet has the following form:

Class           Last Name             First Name
 A                 Dow                  John
 A                 Cave                 Nick
 A                 Jackson              Michael
 B                 Presley              Elvis
 B                 Bowie                David

In the second sheet I want to filter out the rows according to their class. For example, to have a dropdown list with the values A and B, and when I choose A, to see the names of the students of class A.

Which functions do I need?
Thanks.

Attached example.

Column H is helper column to select unique list from class column.

Data validity chooses the value from the list of unique classes in the yellow cell. Validity list is set to sort ascending order.

Column F is helper column to select rows from class column to match the class selected by the yellow cell.

Copy the formula further down the sheet if needed.

It runs a bit slow because I use full length of columns in some formula, example $A:$A, if you know the possible size of your data you could use for example $A$1:$A$100 for 100 rows.

Untitled 33.ods