Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone please explain how the answers for the fisrt 3 (and perhaps the last 2..) were derived? I am familiar with relational algebra, but

Can someone please explain how the answers for the fisrt 3 (and perhaps the last 2..) were derived? I am familiar with relational algebra, but these are a bit tricky

image text in transcribed

Each row of the following table shows two queries. In the blank third column of the table write "YES" if the two queries are equivalent, and "NO" if they are not equivalent. Two queries are equivalent if they always return exactly the same answer on all databases All queries refer to a schema containing two relations R(A, B) where A is the primary key and B is a candidate key S(A, B) where A is the primary key (and only key) You may assume that the relations do not contain null values, but do not make any other assumptions about the relations Query 1 Equivalent? (YES/NO) NO YES Query 2 RN S SELECT DISTINCT R.A SELECT R.A FROM R, S WHERE R.B#8 . B SELECT R.A, COUNT(SELECT R.A, COUNT*) FROM R WHERE R. A>3 GROUP BY R.A NO FROM R, S WHERE R,B=S . B YES FROM R GROUP BY R.A HAVING R. A>3

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

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions