0

Hi all, using these tables, Im trying to write a query that will list the students that have taken any type of class (class_level) and how many of that particular type they have taken so using a count of somekind.

Tables:

ATTAIN
PK FK Rank_Num      integer     refers to RANK
PK FK Stu_Num       integer     refers to STUDENT
     Rank_Date      date        

RANK
PK  Rank_Num        integer
    Rank_Name       string
    Rank_Belt       string

REQUIREMENT
PK  Req_Num     integer
FK  Rank_Num        integer     refers to RANK
    Reg_Descript        string      

STUDENT
PK  Stu_Num     integer
    Stu_FName       string
    Stu_LName       string
    Stu_Initial     char
    Stu_DOB     date
    Stu_Join_Date       date    

ATTENDANCE
PK FK   Meet_Num        integer     refers to MEETING
PK FK   Stu_Num     integer     refers to STUDENT
    Attend_Role     string

MEETING
PK  Meet_Num        integer 
FK  Class_ID        integer     refers to CLASS
NN  Meet_Instruct       integer     refers to INSTRUCTOR (to account for every meeting needs an assigned instructor)
    Meet_Date       date

INSTRUCTOR
PK FK   Stu_Num     integer     refers to STUDENT
    Inst_Hire_Date  date
    Inst_Status     string      (compensated or volunteer)

CLASS
PK  Class_ID        integer
    Class_Weekday   string  
    Class_Time      time
    Class_Location  string
    Class_Level     string

any ideas on how to write this? thanks

3
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by TonyG_cyprus
0

Hard to say from just your tables. Start of easy with one table, and extend your query with a join one table at a time.

0

I may be missing something here, but souldn't there be a row in STUDENT for classes taken and some sort of relationship between tables?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.