What is the result of rst performing the cross product of student and advisor, a
ID: 3731324 • Letter: W
Question
What is the result of rst performing the cross product of student and advisor, and then performing a selection operation on the result with the predicate s_id = ID? (Using the symbolic notation of relational algebra, this query can be written as s_id=ID(student × advisor).)
employee (person name, street, city)
works (person name, company name, salary)
company (company name, city)
branch(branch name, branch city, assets)
customer (customer name, customer street, customer city)
loan (loan number, branch name, amount)
borrower (customer name, loan number)
account (account number, branch name, balance)
depositor (customer name, account number)
Explanation / Answer
Answer:
The result attributes include all attribute values of student followed by all attributes of advisor.
The tuples in the result are as follows.
For each student who has an advisor, the result has a row containing that students attributes, followed by an s_id attribute identical to the students ID attribute, followed by the i_id attribute containing the ID of the students advisor. Students who do not have an advisor will not appear in the result.
A student who has more than one advisor will appear a corresponding number of times in the result.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.