Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

relational algebra for Limit Operator

What is relational algebra for these two SQL queries:

Select * from film where film_rating = 'PG' limit 20;

How can we show limit?

Select * from actor, country where first_name='BOB' and country='In';

where first_name is actor's column and country is country table's column...there is no relationship between these two tables...they are independent tables...

so can we use join operator here?

like image 708
Sam Avatar asked Dec 03 '25 19:12

Sam


1 Answers

About the limit in relational algebra. Traditional relational algebra does not support anything like the limit in SQL. This problem has been recognized and studied by Li, Chang, Ilyas and Song in RankSQL: query algebra and optimization for relational top-k queries (SIGMOD 2005). They have proposed a monotonic scoring function F that ranks the results by the sorting operator tauF.

like image 139
Alexander Serebrenik Avatar answered Dec 05 '25 11:12

Alexander Serebrenik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!