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 1 comment (latest comment by Perry Mc Daid, Thursday, 17 Sept 2009, 17:46)
Share post

This blog might contain posts that are only visible to logged-in users, or where only logged-in users can comment. If you have an account on the system, please log in for full access.

Total visits to this blog: 79496