Sell (Bar, Beer) I want a table in which the first column has the name of the beer and the second has the total number of bars which sell that beer, but I have no idea how to use count () in the right way to obtain this. Could it be Beer G count(Bar) as count_bar (Sell) ? And later that, how could I set a table with the best-selling beer (or the best-selling beers)?
$\begingroup$ How is your algebra's count defined? If you suspect that use, why, & what are you sure & unsure about? How is this like or not like some similar example you can quote & understand? Otherwise you are just asking us to rewrite the documentation with no idea where or why you are stuck. Quote the documentation for your algebra's count. PS There are many RAs (relational algebras). They differ in operators & even what a relation is. Give operator definitions & your reference for yours. Eg textbook name, edition & page. PS Please ask 1 question per post. How to Ask help center $\endgroup$
Commented Oct 10, 2020 at 21:52$\begingroup$ I think I was very clear about what I want to do. Just by the name of the count operator you can understand its functionality a little bit. I would like to understand how that value is returned and how I could write the result of what I want using this operator, which counts how many times some value appears. As a matter of fact, as there were two simple questions, I thought it would be okay to ask both. @philipxy $\endgroup$
Commented Oct 10, 2020 at 22:46 $\begingroup$ Does this answer your question? Use count() in relational algebra $\endgroup$ Commented Oct 10, 2020 at 23:00$\begingroup$ Your comment doesn't counter anything in mine. PS Especially "There are many RAs". (There is among RAs at least one aggregation operator called G. We don't know if it's yours. Or if it's even in your RA. And it isn't a count operator per se, although it can count. But you should know that from the definition you have been given.) PS Please clarify via edits, not comments. $\endgroup$