How can I select data from multiple SQL tables? -


i have 2 tables, described below:

grades

student id,  exem1,  exam2,  exam3 

names

student id,  names 

i want display names of students, average on 3 exams, , letter grade. letter grade computed follows:

90+ “a”, 80 - <90 “b”, , on. how should it.?

> select n.student_names, ((g.exam1+g.exam2+g.exam3)/3) 'average_result', (case                when ((g.exam1+g.exam2+g.exam3)/3) =90                    'a'                when (((g.exam1+g.exam2+g.exam3)/3) between 80 , 89)                    'b'                when (((g.exam1+g.exam2+g.exam3)/3) between 70 , 79)                    'c'                else 'd') end 'student_grades', names n, grades g n.students_id = g.students_id; 

using between include ranges


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -