Madhavan Mukund



Assignment 1

16 September, 2024, due 27 September 2024


Problem statement

Consider the following relation schema from the university database discussed in the lectures.

    instructor(ID,name,dept_name,salary)
    department(dept_name,building,budget)
    course(course_id,title,dept_name,credits)
    prerequisites(course_id,prereq_id)
    section(course_id,sec_id,semester,year,building,
            room_number,time_slot_id)
    teaches(ID,course_id,sec_id,semester,year)
    student(ID,name,dept_name,tot_cred)
    takes(ID,course_id,sec_id,semester,year,grade)
    

Here student contains information about students in the university, and takes contains information about course registration by students.

Write relational algebra queries for the following. Use only the operators discussed in class: select, project, join, assignment, renaming, and set-theoretic operations.

  1. Find the department(s) with the minimum budget.

  2. Find all departments that do not share a building with any other department.

  3. Find all faculty members who teach exactly one course.

  4. Find all courses that have more than one pre-requisite.

  5. Find all courses that are pre-requisites for more than one course.

  6. Find all students who are not registered for any course in 2018.

  7. Find all students who have repeated a course.


How to submit

  • For each problem, in addition to the relational algebra expression, write a short informal explanation explaining your solution.

  • Submit your solutions on Moodle.

  • Your submission should be a pdf file. It can either be generated using some document writing software, or a scan of a handwritten document.