Microsoft Word – Exercise 2_Relational Algebra.docx
Exercise 2
A)
Question 1
Get the student ids of the students who got more than 70 marks in the subject
1011.
Question 2
Get the names and subject codes for which the students got more than 70 marks
in the subject.
B) Consider the following relational schemas:
author (authorID, firstName, lastName)
authorPub (authorID, pubID, position)
book (bookID, title, month, year, authorID)
pub (pubID, ptitle, bookID)
Question 3
Find the name of all authors who are book editors.
Question 4
Find the name of all authors who are not book editors.
Question 5
Find the name of all authors who have at least one publication in the database.
Question 6
Find the name of the authors authored a pub that was published in July.
Question 7
Find the name of all authors who are book editors but do not have any
publication in the database.
C) Consider the following relational schemas:
Student (studentID, name, age, gender)
Course (courseID, courseName, faculty)
Enrolment (courseID, studentID)
JobRequirement (job, courseID)
Question 8
Find the name of female students who have enrolled in at least one course
required by the “designer” job.
Question 9
Find the name of students who have enrolled in all the courses needed by the
“designer” job and never enrolled in any courses offered by the “law” faculty.
(You can treat student as unique attribute, i.e., there are no duplicate names for
any pair of distinct student ids)
Question 10
Find the name of courses in which the students are all male students or all
female students.