a is correct but can be shorter. You have 3 ops, only two are needed. b is incorrect (but I'm not going to spoonfeed anything more).
Finding Attributes using Relational Algebra
-
30-06-2022 - |
Question
I have a couple of questions that I'm unsure of. Here goes...
The schema:
Instructor(InsID, I_Name,DeptName,Salary)
Student(SID,StName,DeptName, Tot_Credit)
Course(Course_ID,Course_Title,DeptName, credits)
a. Find the course titles for all 3-credit courses offered by the Science dept.
b. Find the student IDs for all students who studied with the Instructor Johnson
I tried to answer them, but I'll need someone to verify/help me find the correct answer.
a. (Pi)Course_Title(Course|X|((sigma)(credits=3 and DeptName="Science")(Course)))
b. (Pi)SID((sigma)(I_Name="Johnson")(Instructor))
I'm not sure if those are correct, but any help would be appreciated.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow