Database Systems, CSCI 4380-01 Homework # 1

$30.00

Category:

Description

5/5 - (4 votes)

Question 1. The following queries only need a single SELECT (σ), followed by a PROJECT (π)
and RENAMING (ρ) as necessary:
(a) Return the first and last name of all students who have opted in to the homeworks before
’9/25/2018’ and did not opt out.
(b) Return the id and points for all homeworks that are due before ’Exam’, 2.
1
Question 2. The following queries combine SELECT (σ), SET operations (∩, ∪, −), PROJECTION (π) and RENAMING (ρ) as necessary:
(a) Find and return the name, id and points of all exams and homeworks given or had due dates
before ’11/22/2018’.
(b) Find the id of homeworks that no student has submitted.
(c) Find and return the RIN of all students who turned in both homeworks 1 and 2.
Question 3. The following queries combine SELECT (σ) statements with any number of JOINS
as neede (./, theta or natural) (or CARTESIAN PRODUCT), followed by a PROJECT (π) and
RENAMING (ρ) as necessary:
(a) Find the first and last name of all students who submitted homework #1.
(b) Find the RIN and Exam 1 grades of all students who submitted at least one homework due
before Exam 1.
Question 4. Freeform, you decide which combination is needed. Any relational algebra operator is
fine. Remember to construct these in parts and provide comments on what each part is computing.
This will make it possible for us to give partial credit.
(a) For each student, return their RIN, name, exam/homework name, exam/homework id, grade
and points for all exams (including quizzes) and homeworks that they have a grade for.
(b) Find and return the RIN and Exam 1 grade of the students who did not complete any of the
homeworks before Exam 1.
If you are finished with all these queries but find yourself in need of a personal challenge, try to write
this query to explore the expressive power of relational algebra (no hw credit for this question):
Find and return the RIN of all students who have completed all the assigned homeworks. Also try
to find students who completed two homeworks in a row. (No credit for these questions, try them
to challenge yourself.)
SUBMISSION INSTRUCTIONS. Submit a PDF document for this homework using Gradescope. No other format and no hand written homeworks please. No late submissions will be
allowed.
The gradescope for homework submissions will become available by Tuesday September 11 the
latest. We will announce it on Piazza.
2