SQL exercise [closed]

1

Good afternoon guys, I'm doing the following exercise but I'm not sure if I did it right or not, could you take a look?

Type the SQL queries according to the database schema given below.

a. Select the year, semester and the name of the courses taught by [João Setubal].

b. Select the RA and the names of the students [Jacques Wainer] who attended the course [Evolutionary Algorithms] in the semester [1] between the years [2008] and [2010].

Student - (ra, student_name, admission_year, birth_date)

Course - (id, professor_name, course_name, year, semester)

Disciplina - (id, course:id, student:ra, grade_a, grade_b)


a. SELECT year semester course_name FROM Course WHERE professor_name = “João Setubal”

b. SELECT t1.ra, t1.student_name 
FROM Student t1 
INNER JOIN Disciplina t3 ON (t1.ra = t3.student:ra)
INNER JOIN Course t2 ON (t2.id = t3.course:id)
WHERE t2.professor_name = “Jacques Wainer” 
AND t2.course_name = “Evolutionary Algorithms” 
AND t2.semester = 1
AND t2.year BETWEEN 2008 AND 2010
    
asked by anonymous 18.03.2015 / 19:01

0 answers