How to write these statements in Relational Algebra? Don't know how to do the Limit.
SELECT jid, jobname
FROM Application Natural JOIN Job
GROUP by jid
ORDER BY count(jid) DESC
LIMIT 1;
How to write these statements in Relational Algebra? Don't know how to do the Limit.
SELECT jid, jobname
FROM Application Natural JOIN Job
GROUP by jid
ORDER BY count(jid) DESC
LIMIT 1;
"How to do the Limit"? Note that it is LIMIT 1. So we only want the maximum by count(jid).
My answer here finding max value among two table without using max function in relational algebra shows how to get a max (and links to another example).
Hint: the SQL given is max of a count. So you'll first have to group on jid, get count(jid) as an attribute, then duplicate that grouped table for the max trick.
If you want some LIMIT greater than 1, it's possible but gets very nasty.