Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Database Description. Suppose you are given the following database for keeping t

ID: 3746023 • Letter: D

Question

Database Description. Suppose you are given the following database for keeping track of grades in this course students(rin, fname, lname, email, optin.date, optout.date) exams (name, id, exam.date, maxgrade, points) examgrades(rin, name, id, grade) hws (id, name, points, given date, due date, maxgrade nextexam_name, nextexam id) hwgrades(rin, id, submission date, grade) Each student may have an opt-in date, if there is no date (i.e. the value is NULL) then the homeworks are optional for this student. If there is an opt-in and no opt-out date, then homeworks date within within the given dates are required The exams relation contains both quizzes and exams, stored in name, id fields as 'Exam', 1 Exam', 2, 'Exam', 3 (for final), or 'Quiz', 1, 'Quiz', 2, etc. The id is used to show which exam comes after another. The grade for each exam references both the name and the id of the exam for each student and their grade. Homeworks are stored similarly in the hws relation with id 1,2,3, etc. For each homework, the upcoming (midterm or final) exam is listed. As discussed, points for skipped homeworks will count towards the next exam. The name for each homework is 'hu' for simplicity The grades for each homework is stored similarly in hugrades where id is the id of the homework. Note: All date fields are formatted as mon-day-year, e.g. 01-31-2016. You can assume that you can check if a date value X comes after another value Y by checking whether X > Y Write the following queries using relational algebra (pay attention to the attributes required in the output!)

Explanation / Answer

a)select name,id,points from exams

where exam_date<2018-11-22

union all

select name,id,points from hws

where duedate<2018-11-22 or given_date=2018-11-22;

b)select id from hwgrades

where rin is null;

c)select rin from hwgrades

where id=1 and id=2;