How do I get the some of the values from 2 foreign keys in a table? I've spent a good amount of time on this but, still have no idea as to the sql query I can use to get the student name, and class name from the payments_per_student table. 

edit: This using JPA work with this DB. Knowing the JPA way as well SQl way would be interesting. I'm currently researching the JPA way.

payments_per_student:

PAYMENTS_PER_STU_ID                           
STUDENTS_STUDENT_ID                           
FAMILY_ACCOUNT_FAMILY_ID                        
REASON_FOR_PAYMENT                          
AMOUNT                                                     
DATE_PAID                                                 
CLASSES_CLASS_ID                                    
ACTIVE_IN_CLASS                                      
NOTES          


The second is, Classes:

CLASS_ID                               
CLASS_NAME                      
DAY_OF_CLASS                  
TIME_OF_CLASS             
DURATION_OF_CLASS   
PRICE_PER_CLASS         
PRICE_PER_TERM          
PRICE_PER_YEAR          
NOTES        


The third table is, Students:

STUDENT_ID             
FIRST_NAME           
LAST_NAME           
FAMILY_ACCOUNT_ID   
SEX_TYPE          
NAME_PREF           
DATE_OF_BIRTH      
PERFORMANCE_STU          
HEALTH_ISSUES      
NOTES
This is a good start:

select S.FIRST_NAME,    C.CLASS_NAME,    C.DURATION_OF_CLASS
FROM STUDENTS S
INNER JOIN PAYMENTS_PER_STUDENT A ON S.STUDENT_ID=PAYMENTS_PER_STU_ID
INNER JOIN CLASSES_R C ON A .CLASSES_CLASS_ID = C.CLASS_ID;


I found it + here.