3

Among Codd's 12 rules for Relational Database Management Systems is Rule 1, which states the following:

Rule 1: Information rule

All information(including metadata) is to be represented as stored data in cells of tables. The rows and columns have to be strictly unordered.

Why is it important that metadata be stored in tables?

2 Answers 2

1

None of Codd's rules live in isolation. They all work together to give you that wonderful experience you have today with modern RDBMS, which we all take for granted today. Because before Codd's rules, the world was a horrible horrible place that we "youngsters" didn't know and the "elders" desperately try to forget.

Just imagine that horrible world where for every little task, you had to read a different user manual, use a different programming language, apply a different mindset, paradigm, etc. etc.

I think about it every time I'm surprised I can't do some simple administrative task from my favourite SQL editor (Dbeaver in my case, you can use whatever other tool you want, another side effect of Codd's rules!). Like

  • Creating a user.
  • Giving that user some grants.
  • Creating a database.
  • Dropping a database.
  • Importing data
  • Renaming things.
  • Migrating things.
  • Updating things.
  • Reading things. Including meta data things.

I can do all of these things using a single tool (if I have the privileges, of course). I don't have to go to some weird command line and learn some funky commands. I don't have to write a script in a language that only 3 people on the planet understand. No. It's all SQL (Rule 5 "The comprehensive data sublanguage rule").

And with respect to Rule 1, like all rules, it doesn't live in isolation. Just imagine, in order to check whether that column that you want to add already exists. Imagine you had to go outside of that wonderful realm of SQL for the check and come back later to add the column. No. You don't. You run a quick:

SELECT * 
FROM information_schema.columns
WHERE table_schema = :table_schema
AND table_name = :table_name
AND column_name = :column_name

And you can script that, again, in SQL or a procedural language that is an extension to SQL. Never leaving that single ecosystem where you can do almost every task you need to do in your RDBMS.

By the way, Codd's rules don't have to be strictly about RDBMS even if that's what they're designed for. If the politics is allowed to be removed from the rules, they could apply to all DBMS.

2
  • 2
    (speaking as an "elder" ...) Codd's rules are aiming to distinguish a 'Relational' DBMS from the DBMS's available in the late '60's. They are not true of "all DBMS"s, even if you'd like them to be. And they're not all true of SQL. I don't find my experience of SQL (over the past ~40 years) to be "wonderful", although it is better than previous models. Possibly it would be more wonderful if SQL complied better with Codd's rules. (And followed better language design principles, rather than being a mess thrown together by hardware engineers.)
    – AntC
    Mar 25, 2021 at 23:44
  • 1
    @AntC: I know the politics that was behind the rules. But outsside of the politics, there's also wisdom that transcends RDBMS. E.g. only Rule 4 references the relational model explicitly, and for no good reason. E.g. in an XML database, the "dynamic online catalog" would be based on an XML document model, and all the other rules would still be useful.
    – Lukas Eder
    Mar 26, 2021 at 9:30
4

Metadata isn't uniquely more important than non-metadata in this context. Rather, his rule just simply wants the reader to realize that "All Information" is inclusive of even the metadata regarding the database itself. This is useful for understanding the structure of the database and the relational model behind it. This is why the Information Schema is part of the ANSI SQL standards.

1
  • 2
    There's a practical reason: querying the schema to find the attributes in a relation or keys or foreign keys can use the familiar SELECT ... FROM ... WHERE ... style.
    – AntC
    Mar 24, 2021 at 5:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.