OU blog

Personal Blogs

M329 TMA1 DB Question GRrrr

Visible to anyone in the world
Edited by Mitchell Cooper, Tuesday, 7 Sept 2010, 18:14

So, this question bugged the hell out of me:

M359 TMA1 2009

So, let's assume we all know that a tuple is a row and we also know this grid represents a table, and its data in a database. What isn't meaningful about the third row?... I stared and stared. Think think think (pooh). I couldn't see anything wrong with it. After a few minutes I decided I couldn't spend any longer on it. One mark and all that.

And then it dawned on me. The question's all about the order records are stored in a database. Of course! clustered index aside, record order is never known in a relational database. Sure, every time we run SELECT TOP 5 * FROM myTable - without an ORDER BY clause - we can guess the records returned but we should in no way expect it.

The answer then is something like: The order of records in a table can not be guaranteed. Each record is identified by its key, not its order...

So why didn't I like the question? Here it is: The question asks "...about the third tuple..." which surely means we're talking about a problem with the row above. To me this would be clearer if it had been "...about a tuple..." because we're not interested about this particular instance of a tuple. Or maybe even "...about the ninth tuple..." would have been better because at least this way we would have known it's nothing to do with the values above it. Grrrrr over and out.

Permalink Add your comment
Share post

Comments

Perry Mc Daid

New comment

Oh, I thought there was a quintuplet missing smile