GATE / CS ARCHIVE

GATE CSE 2002 / QUESTION 15(a)(i)

Interviewed students receiving no offer

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 2002 paper

GATE 2002, Q15(a)(i) Descriptive
Report issue

Relational Algebra & Calculus

Question 15(a)(i), GATE 2002: Placement schema COMPANY(cname,clocation), STUDENT(srollno,sname,sdegree), INTERVIEW(cname,srollno,idate), OFFER(cname,srollno,osalary). Keys: cname; srollno; (cname,srollno) for each remaining relation. cname and clocation are company name and location; srollno, sname and sdegree are student roll number, name and degree program. Interviews record company/student/date; offers record salary for successful interviews. Original15(a)(i): Using only relational algebra join, selection, projection, union and difference, list roll numbers and names of students interviewed at least once but receiving no offer.
Question 15(a)(i), GATE 2002: Placement schema COMPANY(cname,clocation), STUDENT(srollno,sname,sdegree), INTERVIEW(cname,srollno,idate), OFFER(cname,srollno,osalary). Keys: cname; srollno; (cname,srollno) for each remaining relation. cname and clocation are company name and location; srollno, sname and sdegree are student roll number, name and degree program. Interviews record company/student/date; offers record salary for successful interviews. Original15(a)(i): Using only relational algebra join, selection, projection, union and difference, list roll numbers and names of students interviewed at least once but receiving no offer.
Question 15(a)(i), GATE 2002: Placement schema COMPANY(cname,clocation), STUDENT(srollno,sname,sdegree), INTERVIEW(cname,srollno,idate), OFFER(cname,srollno,osalary). Keys: cname; srollno; (cname,srollno) for each remaining relation. cname and clocation are company name and location; srollno, sname and sdegree are student roll number, name and degree program. Interviews record company/student/date; offers record salary for successful interviews. Original15(a)(i): Using only relational algebra join, selection, projection, union and difference, list roll numbers and names of students interviewed at least once but receiving no offer.
Question 15(a)(i), GATE 2002: Placement schema COMPANY(cname,clocation), STUDENT(srollno,sname,sdegree), INTERVIEW(cname,srollno,idate), OFFER(cname,srollno,osalary). Keys: cname; srollno; (cname,srollno) for each remaining relation. cname and clocation are company name and location; srollno, sname and sdegree are student roll number, name and degree program. Interviews record company/student/date; offers record salary for successful interviews. Original15(a)(i): Using only relational algebra join, selection, projection, union and difference, list roll numbers and names of students interviewed at least once but receiving no offer.
Tap to enlarge
Answer & solution

Answer: π_{srollno,sname}(STUDENT ⋈ (π_{srollno}(INTERVIEW) − π_{srollno}(OFFER))) (no official key was published)

Let I=π_{srollno}(INTERVIEW) and O=π_{srollno}(OFFER). I−O contains exactly the students with at least one interview and no offer at all. Join this one-column relation to STUDENT on srollno and project srollno,sname:
π_{srollno,sname}(STUDENT ⋈ (π_{srollno}(INTERVIEW) − π_{srollno}(OFFER))).
Only the permitted join, projection and difference operators are needed. Relational-algebra projection removes duplicates, so repeated interviews do not repeat students.

Original paper, page 8