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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With