Database Design

As you can tell by now, the relational model is completely centered around tables. All data in a database is stored in tables, and all queries receive their results in tables. Therefore, when you’re thinking about how to organize your data, it’s important to think about how to group your data within tables. Here are some important rules that apply:

  • All data must be returned by the database in a tabular format.

  • Each field must contain a single value.

  • For the purposes of data integrity, every row must contain a value (or group of values) that uniquely identifies that row.

  • A relationship between two tables is represented by part or all of the data in a column. In other words, the column data that expresses a relationship must appear ...

Get Sams Teach Yourself CGI in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.