The database side

Image

Contrary to public opinion, relational databases aren’t called “relational” because the tables are related to one another. They’re called relational because the tables are the physical representation of a conceptual object called a RELATION. Or at least they should be. Unfortunately, just arranging some stuff in rows and columns like a spreadsheet doesn’t make it a relation. There are rules. Well, one rule, really, but it’s usually understood as a set of NORMAL FORMS: We’ll be exploring them in the next few pages, but here are the basic rules:

Image

Image Words For the Wise

Here’s an easy way to remember the rules for normal forms:

The key, the whole key, and nothing but the key



Image Put On Your Thinking Hat

Take a look at these two tables. You shouldn’t ever see anything like this in a release database, but you probably will. (If you’ve done much database work, you probably already have.) These are undeniably tables, and they’re even related to each other. But they’re not relations, and this model isn’t a relational database schema, even if it’s implemented in SQL Server.

Image

Can you find at least three ways that this model violate the requirements of relational database design?

 

A database isn’t just supposed to store data; it should also let you ask questions and get reliable answers. Can you see at least one question that this data should be able to answer, but can’t?



Image How’d You Do?

There’s a lot wrong with this database, but here are the obvious things....

Image

A database isn’t just supposed to store data; it should also let you ask questions and get reliable answers. Can you see at least one question that this data should be able to answer, but can’t?

What’s Sam Pettigrew’s phone number?

Who’s the primary supplier for Dill?

What products do we get from Nimble Goat Farm?


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset