MyUniversity (primary keys are in italic) classroom(building, room_number, capac
ID: 3928113 • Letter: M
Question
MyUniversity (primary keys are in italic)
classroom(building, room_number, capacity)
department(dept_name, building, budget)
course(course_id, title, dept_name, credits)
instructor(id, name, dept_name, salary)
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) advisor(s_id, i_id)
time_slot(time_slot_id, day, start_time, end_time) prereq(course_id, prereq_id)
Interpret relational algebra by writing the English equivalence.
- id ( salary > 50000 (instructor))
- name ( dept_name = ‘Comp. Sci.’ (instructor))
- id ( instructor.id = teaches.id AND instructor.dept_name = ‘Comp. Sci.’ AND teaches.year = 2014 (instructor X teaches))
- id (student) – id (advisor)
Explanation / Answer
1) output all the instructor id's with salary greater than 50000
2) get names of instructors working in computer science department
3)get the id of instructors who worked for computer science department during year 2014 by joining instructor and teaches table
4) remove all instructors records from the students records to get students who are not instructors by referring their ID's
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.