Hello everybody, hello Dani:icon_cool:!

I'm doing my homework of 'Data Base', exactly in the chapter: Relational Algebra, here I am, I can't find a specific relation (or the SQL corresponding query) :icon_confused:!

Here the schema:

MEAL(guest,date);
MENU(dish,date);
PREFERENCE(person,dish);

I wanna find the SQL query (or the relation in Relational Algebra):"the guests who attended to every dish".

I hope find a solution or a lil hint:icon_neutral:!
Greeting:icon_rolleyes:!

I hope that the question was clear.
well, I thing that we must use the division operation, but how?

You can do this by having a sub-query which uses a RIGHT join to link PERSON and MENU (I don't think that MEAL is relevant here.)

Then SELECT DISTINCT from the resultant data set all of the PREFERENCE.PERSON where the linked MENU.DISH is not NULL.

There, that may help. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.