Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Student(snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets at: string, room: string, fid: integer) Enrolled(snum: integer, cname: string) Faculty(fid: integer,

Student(snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets at: string, room: string, fid: integer) Enrolled(snum: integer, cname: string) Faculty(fid: integer, fname: string, deptid: integer) The meaning of these relations is straightforward; for example, Enrolled has one record per student-class pair such that the student is enrolled in the class.

Write the following queries in relational algebra NOT SQL. No duplicates should be printed in any of the answers. What is the relational algebra from the question below. I already have the SQL and need it in relational algebra.

6. Find the names of faculty members for whom the combined enrollment of the courses that they teach is less than five.

SELECT DISTINCT F.fname

FROM Faculty F

WHERE 5 > (SELECT COUNT (E.snum)

FROM Class C, Enrolled E

WHERE C.name = E.cname

AND C.fid = F.fid);

8. For all levels except JR, print the level and the average age of students for that level.

SELECT S.level, AVG(S.age)

FROM Student S

WHERE S.level <> JR

GROUP BY S.level;

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

Students also viewed these Databases questions

Question

Find y'. y= |x + X (x) (x) X 1 02x+ 2x 1 O 2x + 1/3 Ex 2x +

Answered: 1 week ago