Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose the relation R 1 ( A , B ) and R 2 ( B , C , D ) have the following tuples: Compute

Suppose the relation R1(A,B) and R2(B,C,D) have the following tuples:
Compute the theta-join of R1 and R2 with conditions R1.B = R2.B AND R1.A < R2.C. Which of the following tuples is
in the result? Assume each tuple has schema (A, R1.B, R2.B, C, D).
a)(2, G, T,8,9) b)(4, C, C,7,8) c)(4, C, C,5,6) d)(1, A, C,4,3)
Questions (7,8,9, and 10). Give the following queries in the relational algebra using the relational schema:
student(id, name)(can be called ST)
enrolledIn(id, code)(can be called EN)
subject(code, lecturer)(can be called either SU1 or SU2)
Who teaches cs1500 or cs3020?
Who teaches at least two different subjects?
What are the names of students in cs1500 or cs3010?
What are the names of students in both cs1500 and cs1200?
Bonus question. Consider the database with the following schema:
Person(name, age, gender) name is key
Frequents(name, iceCreamShop)(name, iceCreamShop) is a key
Eats(name, flavor)(name, flavor) is a key
Sells(iceCreamShop, flavor, price)(iceCreamShop, flavor) is a key
Find an ice cream shop that is frequented by people older than 30 but younger than 40 years old.
A B
1 A
7 T
2 G
4 C
9 T
B C D
C 56
A 78
T 89

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_2

Step: 3

blur-text-image_3

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