View Full Version : Troubling query


hxp
06-10-2009, 12:41 PM
Hello, I have been trying to make a query which gives me "All movies that has been shown in all cinemas". The table structure looks like this (only listing the relevant tables and columns):

Table name: {Column names} (#name = primary key and *name = foreign key).

Cinema: {#cinema_id, ...}
Auditorium: {#auditorium_id, *cinema_id, ...}
Performance: {#performance_id, *auditorium_id, *movie_id, ...}
Movie: {#movie_id, ...}

This query has been driving me nuts and I'm posting the question here to get some fresh ideas :P

All answers are appreciated, thanks in advance :)
~ Michael

namliam
06-10-2009, 11:31 PM
The trick would be to figure out what "all cinemas" is... The easiest way is to do this in 2 steps
1)
So you would need to find first a unique combination of movie + Cinema

2)
Find out if this lists all cinema's or not...

I hope this idea is 'fresh' enough to help you get started...
Greets!