Some clues allow more than one interpretation:
"The green office was to the left of the white office." - is that directly to the left (adjacent) or somewhere to the left?
"Sue has the first office." - is that the leftmost or the rightmost office?
I've made the assumption that the green and left office need not be directly adjacent, and the the first office is the leftmost office. With those assumptions, there are a total of six solutions to the problem. In two, Sue has the Dual 19" LCDs. Andy gets them in three, and the last solution has Brian working the dual 19" LCDs.
Of course, I didn't work this out for mysself. This is a SQL Server forum, after all!!
(I hope the formatting comes out okay....)
Okay, so my assumptions were wrong.
The green office was to the left of the white office." - is that directly to the left (adjacent) or somewhere to the left?
I've made the assumption that the green and left office need not be directly adjacent, and the the first office is the leftmost office. With those assumptions, there are a total of six solutions to the problem.
After changing my query to the three other possible combinations of interpretations, I found an interpretation that leaves just one single answer to the question.
If we assume the the green office is directly adjacent (to the left) if the white office, AND that the first (Sue's) office is to the far right, then my query returns just two rows - and in both rows, Andy is the lucky one who gets to play with the dual 19" LCDs.
Here's the changed part of the query:
-- The green office was to the left of the white office.
BTW, the execution plan is definitely, ahem, "interesting"
It certainly makes a difference depending on whether one assumes the "first office" means rightmost or leftmost.
I also worked this out using SQL Server (it's supposed to be a logical inference engine, after all!)
I noticed that the relations I end up with that fulfill the constraints leave open the question of which offices(positionally) certain engineers occupy, and which drinks they like.
I would say it has to be Andy did it in the Yellow office with the spare change in his pocket.
Howevr I am the third gunman on the grassy knoll who just happens to have dual 19s.
Fortunately, I had kept my query window open over the day!
With the clarification that first = leftmost (my first assumption) and the additional hint that the red house (office) is in the middle, I still get three solutions with the green offfice directly left of the white office, and even four solutions with the green office "somewhere to the left" of the white office.
In both lists, the 19" Dual monitor can be in Sue's, Andy's, or Brian's office.
(Just run the SQL I included in my first post, with this additional line for the Combinations view: