Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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. image text in transcribed

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

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

More Books

Students also viewed these Databases questions

Question

9 - 3 : Bond Valuation G Problem Walk - Through Bond valuation $ C

Answered: 1 week ago

Question

5. Describe the visual representations, or models, of communication

Answered: 1 week ago