4. T3 := Sel Courses.Credit points >4 (T3) T3 Courses . Course name Courses . CID Courses . Room Courses . Time Courses . Credit Points Professors . Professor Name Professors . Office Professors . CID Mathematics 575 N502 3:00P.M. 5 Rosen K103 575 Zoology 335 A100 9:00A.M. 5 Cruz K100 335 Zoology 412 A100 8:00A.M. 6 Cruz K100 412
5. T4:= P Course s . Course Name , Course s .CID , Professors.Professor Name (T3) T4 Courses . Course name Courses . CID Professors . Professor Name Mathematics 575 Rosen Zoology 335 Cruz Zoology 412 Cruz
Find professors ’ names who are giving courses to student Adams in the room A100 1. Needed tables : Courses Professors Students 2. T1:=Courses x Professors x Students 3. T2:=Sel Courses.CID=Professors.CID=Students.CID (T1) 4. T3:=Sel Students. Student Name = Adams & Courses . Room =A100 (T2) 5. T4:= P Professors.Professor Name (T3)
Find professors ’ names and course names of courses with grades are less than 3.5 1. Needed tables : Courses Professors Students 2. T1:=Courses x Professors x Students 3. T2:=Sel Courses.CID=Professors.CID=Students.CID (T1) 4. T3:=Sel Grade <3.5 (T2) 5. T4:= P Professor Name , Course Name (T3)
Pseudo code operations
Uses predicates GET R ( t.attr):C where R - new table t.attr – queried values from current tables C - condition
Find professor offices ( If the searched result is in one table ) Profesor Offices Office K100 K101 K102 K103 GET Professor Offices ( Professors.Office )
Find course ID wh ich happen s in the room A100 at 9:00 A.M. GET COURSE ( Courses.CID ): Courses.Room = A100 & & Courses.Time=9:00A.M.
Find courses (names) given by Rosen As needed information is in two tables then variable x is used x is record ( tuple ) from table Professors GET CN ( Courses.Course name ): x (x Professors & & x. Professor name = Rosen & & x.CID=Courses.CID ) to join If the result is in two tables !
Find grades in the course given by Rosen at 2:00 PM GET GR ( Students.Grade ): x Courses & x.Time=2:00 P.M & & y Professors & & y.Professor name = Rosen & & y.CID=x.CID=Students.CID If the result is in three tables !