Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer with copyable code and please show the steps: Write the Relational Algebra needed to satisfy all 7 requests. Write no SQL. No resulting

Please answer with copyable code and please show the steps:

Write the Relational Algebra needed to satisfy all 7 requests.

Write no SQL. No resulting data is needed, just show the Relational Algebra expression(s).

Show the steps used to obtain your answer, as partial credit can only be given if your work is shown.

You should copy each question and include it in your answer. (Use the Student Course Database and Schema to help if you need)

1 .All Students who are in the freshman class (class is 1).

2. All Courses in offered in the math department that are at least 2 credit hours.

3. The building number and room number of all rooms.

4. The student name and major of all seniors (class is 4).

5. The student number, section id and grade of all junior computer science majors, who have received a C in any course. (Must Use a Join)

6. The Accounting courses number of all courses taught in 1999. (Cannot use a join , use one of the Math Set Theory Operations. )

7. The room capacity of all rooms in building 10 that were never used the Computer Science course COP5725.(Do not use a join to solve this question, use one of the Math Set Theory Operations.)

The Student Course Database

Student

stno NOT NULL NUMBER (3)

PRIMARY KEY NOT NULL

sname VARCHAR2(20)

major CHAR(4)

class NUMBER(1)

bdate DATE

Grade_Report

student_number NOT NULL NUMBER(3)

section_id NOT NULL NUMBER(6)

grade CHAR(1)

PRIMARY KEY (student_number, section_id)

Section

section_id NOT NULL NUMBER(6)

PRIMARY KEY NOT NULL

course_num CHAR(8)

semester VARCHAR2(6)

year CHAR(2)

instructor CHAR(10)

bldg. NUMBER(3)

room NUMBER(3)

Department_to_Major

dcode NOT NULL CHAR(4)

PRIMARY KEY NOT NULL

dname CHAR(20)

Course

course_name CHAR(20)

course_number NOT NULL CHAR(8)

PRIMARY KEY NOT NULL

credit_hours NUMBER(2)

offering_dept CHAR(4)

Room

bldg NOT NULL NUMBER(3)

room NOT NULL NUMBER(3)

capacity NUMBER(4)

ohead CHAR(1)

PRIMARY KEY (bldg., room)

Prereq

course_number CHAR(8)

prereq CHAR(8)

Schema

A: A Student MAY be registered in one or more (M) Grade_reports.

A Grade_report must relate to one and only one Student

B: A Section MUST have one or more (M) Grade_Reports.

A Grade_report MUST relate to one and only one (1) Section.

C: A Section MUST relate to one and only one (1) Course.

A Course MAY be offered as one or more (M) Sections.

D: A Student MAY be related to one and only one (1) Department_to_major.

A Department_to_major may have one or more (M) Students.

E: A Course MUST be related to one and only one (1) Department_to_major.

A Department_to_major MAY offer one or more (M) Courses.

F: A Section MUST be offered in one and only one (1) Room.

A Room MAY hose one or more (M) Sections.

G: A Course MAY have one or more (M) Prereq.

A Prereq MAY be a prerequisite for one or more (M) Courses.

PRIMARY KEY (course_number,prereq)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

EXPLAIN WHMIS legislation.

Answered: 1 week ago