write the following questions as queries in Relational Algebra. Use only operato
ID: 3881555 • Letter: W
Question
write the following questions as queries in Relational Algebra. Use only operators discussed in class (select, project, Cartesian product, join, union, intersection, set difference, and renaming)
2. Consider the following database schema: RESEARCHER (name,institution,city,country) PAPER(title, journal,volume,number,year), AUTHOR (rnane,ptitle), where name is the identifier (primary key) of a researcher, institution is where the researcher works and city and country the city and country where the institution is located; title is the paper identifier (primary key), journal is the journal where it was published (in volume volume and number nunber), and year is the year it appeared. Finally, rnane is a foreign key for Researcher and atitle is a foreign key for Paper. A rescarcher may write several papers, and papers may be jointly written by several rescarchers; this means that the key of Author is (rnane,atitle). Write the following queries in Relational Algebra (a) Find the names of authors from an institution in Louisville who have publishesd a paper in journa Science' after 2005 (b) Find the titles of papers with two or more authors. (e) Find the name and institution of a co-author of a Harvard aathor (this means: if a has written a paper together with b, and b is from Harvard, you need to include a in the answer). (d) Find the names of authors who have never published a paper in journal 'Science' (e) Find the titles of papers with a single author.Explanation / Answer
a.
name ( institution = "Louisville" and year > 2005 and journal ='Science' (RESEARCHER name = rname AUTHOR ptitle = title PAPER))
b.
ptitle ( count(rname) >= 2 group by ptitle (AUTHOR))
c.
R2.name,R2.institution ( R1.institution = "Harvard' (RESEARCHER R1 RESEARCHER R2 ))
d.
name ( journal !='Science' (RESEARCHER name = rname AUTHOR ptitle = title PAPER))
e.
ptitle ( count(rname) =1 group by ptitle (AUTHOR))
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.