Question: Problem 1: [20 pt] Relational algebra. Following is the schema for character- episode-appearance relation Characters(name, type): assume characters have distinctive names name type BobA Appearances

 Problem 1: [20 pt] Relational algebra. Following is the schema for

Problem 1: [20 pt] Relational algebra. Following is the schema for character- episode-appearance relation Characters(name, type): assume characters have distinctive names name type BobA Appearances (name, season, num) Jon EmmaB Olivia C name season num Bob Bob 1 Jon Episodes (season, num, title, viewers) Jon2 Emma1 Emma 1 Emma 2 Bob 2 Olivia 2 season num title viewers Winter 2.5 M 2 King 2.5NM 1 Notes 4.0 M 2 Lands 3.2 M 2 2 If a query requires a join, and it is not a natural join, you should make the join condition explicit. (a) [5 pt] Write two equivalent relational algebra queries that list the types other than type A. (b) [5 pt] Write a relational algebra query that computes the names of characters that appear in both season 1 and season 2. (hint: choose from set operators such as union, intersect and set_diff) (c) [5 pt] Write a relational algebra query that computes the names of characters that appear in some episode with more than 3M viewers. (hint: join is needed) (d) [5 pt] Write a relational algebra query that computes pairs of characters that appear together in some episode in season 1. Each tuple of the output should have the format: (name1,type1,name2,type2,num). Exclude self pairs: (name1!- name2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!