edited by
1,191 views
1 votes
1 votes

Consider the following schema and relational algebra query.
Student (Sid, Sname, Sage)
Course (Cid, CourseName, Credit)
Enrolled (Sid, Cid)
                                                             πSid(Student) – πSid(σcredit<5 (course) Enrolled)
Which of the following is correct about relational algebra Q?

  • Finds Sid of students who enrolled atleast one course with credit greater than 5
  • Finds Sid of students who enrolled all courses with credit greater than or equal to 5
  • Finds Sid of students who enrolled all courses with credit less than 5
  • None of these

first option should be correct one??
nut 2nd one is given correct plz someone tell me why Second option not first one.

edited by

1 Answer

Best answer
4 votes
4 votes

πSidcredit<5 (course) (Natural Join)Enrolled) it will project all Sid's who enrolled all course having Credit <=4

 πSid(Student) =It will list Sid's

Finally,

{All Sid's-All Sid's who enrolled all courses having Credit<=4}==All Sid's but Credit not<=4==students who enrolled all courses with credit greater than or equal to 5.

selected by

Related questions

–1 votes
–1 votes
0 answers
1
Himanshu Kashyap asked Jan 12, 2019
658 views
PLEASE EXPLAIN WHEATHER IT WOULD BE SOME EC DEPARMENT OR ALL EC DEPARTMENT I THINK ALL BECOZ IT IS SELECTION EID OF STUDENT WHO HAVE NOT ENROLLED IN ANY COURSE OF EC
1 votes
1 votes
1 answer
3
nikkey123 asked Jan 29, 2018
1,613 views
Consider the following database tableSupplier (Sid, Sname, rating)Parts (Pid, Pname, color)Catalog (Sid Pid, cost)Which of the following SQL query correct representation ...