English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm trying to find the following
find every department that has a professor who taught all courses offred by that department.
Using relational algebra and then using SQL.
The schema is as follows:
Student(Id:Integer, Name:String, Address:String, Status:String)
Professor(Id:Integer, Name:String, DeptId:String)
Course(DeptId:String, CrsCode:String, CrsName:String, Descr:String)
Transcript(StudId:Integer, CrsCode:String, Semester:String, Grade:String)
Teaching(ProfId:Integer, CrsCode: String, Semester:String)

Any help would be much appreciated, I'm starting think that it is near impossible to represent this in a one line relational algebra formula.

2006-09-29 03:37:34 · 2 answers · asked by patrickdenney2 2 in Science & Mathematics Mathematics

I know relational algebra, I'm just having problems finding a formula that will find the results for EVERY department. If a department was specified I think a simple / on a couple easy queries should do it . pi_Id,CrsCode(Natural Join(TEACHINGXPROFESSOR)/pi_crscode(sigma_dept='specific dept(COURSE)) If I'm that that should give me the Id of the professor who has taught every course in that specificed department.

but how would I get the same results listed all departments is the count was unknown and I had to do it in 1 relational alg. forumla.

2006-09-29 04:53:13 · update #1

I know relational algebra, I'm just having problems finding a formula that will find the results for EVERY department. If a department was specified I think a simple / on a couple easy queries should do it . pi_Id,CrsCode(Natural Join(TEACHINGXPROFESSOR)/pi_crscode(sigma_dept='specific dept(COURSE)) If I'm right that should give me the Id of the professor who has taught every course in that specificed department.

but how would I get the same results listed all departments is the count was unknown and I had to do it in 1 relational alg. forumla.

2006-09-29 04:53:46 · update #2

2 answers

These seem as simple relationships.
Draw a diagram to see which subsumes which.

2006-09-29 03:44:39 · answer #1 · answered by Edward 7 · 0 0

http://db.grussell.org/section010.html
http://db.grussell.org/ch9.html


BETWEEN (Inclusive) List all the courses which occurred during 1988 SELECT * FROM course WHERE cdate BETWEEN '01-JAN-1988' AND '31-DEC-1988'

2006-09-29 03:43:03 · answer #2 · answered by god knows and sees else Yahoo 6 · 0 0

fedest.com, questions and answers