Saturday 15 June 2013

How to solve following Relational Algebra query -



How to solve following Relational Algebra query -

on relational algebra exam had yesterday there question couldn't reply , want know how solved. constraint on question wasn't allowed utilize aggregate functions found difficult. schema follows.

employee = {id, name, phone} id pk course of study = {course_no, title, subject} course_no pk completed = {course_no, student_id, grade, semester} {course_no,id,semester} pk

the question went: list pairs of employees have completed same courses , have completed these same courses in same years , have never received grade 'd' in of these courses. list each pair?

if shed lite great.

basically, first build query joins tables form desired list of properties per employee.

then re-create 2 queries , bring together results on course_no , - guess - semester (and remember exclude rows same employee id appears on both sides).

finally filter result grade.

there other variations possible, general idea.

relational-algebra

No comments:

Post a Comment