Question: Question No. 7: SQL Constructs Understanding 15 marks Consider two SQL tables R and S. In both tables, R and S, attribute A is a


Question No. 7: SQL Constructs Understanding 15 marks Consider two SQL tables R and S. In both tables, R and S, attribute A is a key and attribute B is not a key. No attributes are permitted to contain NULL values. Neither table is empty. Do not make any other assumptions about the data. Decide if the two queries are equivalent, i.e., if they are guaranteed to produce the same answer on all possible states of the database. a) Q1: select A fron R Q2: select R.A from R, S where R.A.S.A W : () Q1: select max(A) from R Q2: select A from where A > all (select A from R) c) Q1: select B fron R Q2: select fron R group by B Q1:select A from where exists (select from where S.A - R.A) Q2: select A from R intersect/select A frons ? Q1: select A from R : A Q2: select A from R group by A
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
