ITEC 3220 Lecture Notes - Lecture 1: Cross Product, Cosc
Document Summary
1 find ids of the courses which students are registered for. We need to query the table of transcripts, some ids will be duplicates, if we have duplicate it cannot consider to be relation. Use algebra, duplicates are automatically eliminated. (projection sign)cid^(t) 2 find the titles of courses, which students are registered for. Need to query 2 tables of course and transcripts. first need to compute cross-product. T x c ( bringing them together, that"s cross-product sign) We will get lots of records then we need: (selection sign)(transcript: c. cid=t. cid)(t x c) 3 find the names of students who have been registered for the course it1010. Try to split into independent part, we are looking for students in itec courses. (selection sign)(transcript:c. pcode="itec")(c) Then we need to join by corss product: ( t x (selection sign)(transcript:c. pcode="itec")(c) ) Then : (selection sign)(transcript: t. cid=c. cid)( ( t x (selection sign)(transcript:c. pcode="itec")(c) ) )