0% found this document useful (0 votes)
32 views4 pages

HW2.3 - Challenging Relational Algebra

This document provides the domain description and relations for a homework assignment on a university research database. It describes entities such as professors, graduate students, projects, departments, and their attributes and relationships. It also provides sample relational algebra queries to retrieve information from the relations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views4 pages

HW2.3 - Challenging Relational Algebra

This document provides the domain description and relations for a homework assignment on a university research database. It describes entities such as professors, graduate students, projects, departments, and their attributes and relationships. It also provides sample relational algebra queries to retrieve information from the relations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Computer Science and Engineering 333

Introduction to Database Systems


Homework #2.3

Name: ____________________________ Section: _____ Mailbox: _______

Below is the domain description for the university scenario from HW1, which may be used in the
problems below. This is solely for reference.

Research University Scenario:


A research university is looking to create a new database to better track their current research projects and
those who are working on them. A professor, with a social security number (SSN), name, age, rank, and
research specialty, can run multiple projects. A project has a number, a sponsor name (for example, NSF), a
start date, an end date, and a budget.

Research universities also use graduate students in their research projects. Graduates students have an SSN, a
name, an age, and a degree program (such as M.S. or Ph. D.). One or more graduate students, work on a
project. A graduate student may work on multiple research projects. When a graduate student is working on a
research project they must be supervised by a professor for that project. A professor may supervise multiple
graduates on one project and/or across many projects. As graduate students could work on multiple projects,
they can have different supervisors for each project they work on. Graduate students also have another, more
senior, graduate student who advises them on what courses to take. This person is a student advisor.
Graduate students in their final year may not have a student advisor assigned to them.

The research university is split into several departments. A department has a number, a name, and a main
office (represented by the office number). Each department has a chairman, who is a professor who runs the
department. A professor may work in one or more departments, and for each department they work for there
is a time percentage that dictates how much time is spent in each department. There are some professors who
work part-time, and their time percentage will not add up to 100%. Graduate students belong to a single
department in which they are working on their degree.
Relational Algebra

Use the following relations from the Research University Schema to answer the problems below.

Relations:

Person(SSN, Age, Name)

Professor(SSN, Rank, Specialty)

GraduateStudent(SSN, DegreeProgram, AdvisorSSN, DepartmentNumber)

Project(Number, StartDate, EndDate, Budget, SponsorOrganizationName)

Department(Number, Name, Abbreviation, MainOffice, ChairmanSSN)

WorksFor(ProfessorSSN, DepartmentNumber, TimePercentage)

WorksOn(GraduateStudentSSN, ProjectNumber, SupervisingProfessorSSN)

Foreign Keys:

Professor(SSN)  Person(SSN)

GraduateStudent(SSN)  Person(SSN)

GraduateStudent(AdvisorSSN)  GraduateStudent(SSN)

Department(ChairmanSSN)  Professor(SSN)

WorksFor(ProfessorSSN)  Professor(SSN)

WorksFor(DepartmentNumber)  Department(Number)

WorksOn(GraduateStudentSSN)  GraduateStudent(SSN)

WorksOn(ProjectNumber)  Project(Number)

WorksOn(SupervisingProfessorSSN)  Professor(SSN)
For each item below, write relational algebra statements to satisfy the given scenario.

a) Retrieve a list of the specialties of all Professors who supervise for Project 39585 and Project 94892.
A single specialty should not be listed twice, even if two professors share the same specialty.

b) Retrieve the Name and Age of all Graduate Students who work on both Project 29385 and Study in
the Department with Name “Biology”.

c) Retrieve the Name and Rank of all Professors who supervise work on Project 29384 or who Work
For the Department with a Main Office of “R234”.
d) Retrieve the Name and Specialty of all Professors who do not supervise work on any projects.

e) Find the Name and Department of all Graduate Students who work on projects that do not employ
any other graduate students.

You might also like