Hello Fahd,
The relational data model is the most used because it is:
- mature (proven and known)
- simple to understand
- fast
- widely supported
The structure of a database is that its made up of tables consisting
of rows and columns.
For example:
First Name | Last Name | Age | Email
John | Doe | 31 | john.doe@example.com
Mary | Smith | 28 | mary.smith@example.com
The relationship can be established by the programmer using a table
join (via SQL).
Take this second table:
Login | SignedUpDate | Email
johndoe | 2002-12-12 | john.doe@example.com
We could now join the two tables by "email", their common column.
The email could serve as a primary key here.
A primary key, which must be unique within individual tables, could
also be the combination of first name and last name. Since names are
not unique, we might want to use a safer, "synthetic" key, that might
be handled by the database using auto-incrementation:
ID | Login | SignedUpDate | Email
1 | johndoe | 2002-12-12 | john.doe@example.com
2 | marysmith | 2002-11-11 | mary.smith@example.com
On to the integrity: this is the referential integrity of the
database. It means that data is not redundant or error-prone in the
sense that e.g. if you delete customer data, also the previous
customer orders must be deleted. You can ensure this using foreign
keys and have the database server enforce integrity rules.
For a good overview of all this, please see:
Introduction to Relational Database Design
http://www.edm2.com/0612/msql7.html
Data Modeling
- Introduction to Data Modeling
- Overview of the Relational Model
http://www.utexas.edu/cc/database/datamodeling/
Hope that helps!
Search terms:
"database design" relational |