Question: (Please hand write this) Relational algebra. Following is the schema for characterepisode-appearance relation. Characters(name, type): assume characters have distinctive names. If a query requires a

(Please hand write this)

Relational algebra. Following is the schema for characterepisode-appearance relation.

Characters(name, type): assume characters have distinctive names. (Please hand write this) Relational algebra. Following is the schema for characterepisode-appearance

If a query requires a join, and it is not a natural join, you should make the join condition explicit.

a. Write two equivalent relational algebra queries that list the types other than type A.

b. 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. 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. 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).

name type Bob A Jon A Emma B Olivia C pearances (name, seas son, num) name season num Bob 1 Bob1 Jon1 Jon 2 Emma1 Emma 1 Emma 2 Bob 2 Olivia 2 Episodes(season, num, title, viewers) seasonnum t title vie wers 1 Winter 2.5 M 2 King 2.5 M Notes 4.0 M Lands 3.2 M 2 2 2

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!