Let T be a relation (table) that consists of only one integer-valued attribute attr
i)Is it possible to write a Relational Algebra query that outputs the first two biggest numbers?
ii)Is it possible to write an SQL query that outputs the first two biggest numbers?
iii) Is it possible to write a Relational Algebra query that outputs the median?
If the answer to each of this questions is yes then you should write the query. If the answer is no then you should provide an intuitive justification why it is not possible.
|
Answer i) NO, because using only one integer Relation Algebra query cannot produce two biggest numbers.
Answer ii) Yes, SQL query can stream relational data to the one integer- valued attributeand by specific programming to check with loops, SQL query can produce first two biggest numbers.
Answer iii) Yes, Relational Algebra query can give median output from the one integer-valued attribute, because it can take the same attribute to find the median of the valued data.
Upvote, if the answer was helpful. Thanks and have a nice & safe day.
Get Answers For Free
Most questions answered within 1 hours.