Notes on Relational Databases:
A database can consist of multiple tables/files. These tables/files are related to each other in some way so that the programmer or developer can access information from multiple table/files at the same time. A database management system is the database and its functionality. In today's PC environment, the model of relating the table/files within a database is the relational database model. Things that must be considered in a relational database:
- Analyze the data and determine how to design the files - consider whether the data is in a one to one relationship, a one to many relationship or a many to many relationship.
- Consider functional dependence: An attribute B, is functionally depended on another attribute, A if a value for A determines a single value for B at any one time.
- The primary key has all attributes in the table functionally dependent upon it - to simplify you can think of the primary key as the minimum collection of fields that will get you one and only one record from the table/file.
- We must also consider the rules of normalization and establish the relationships so that the database is in third normal form.
- A relation is in first normal form if it does not contain repeating groups.
- A relation is in second normal form if it is in first normal form and no non-key attribute is dependent on only a portion of the primary key. (Note: an attribute is a non-key attribute if it is not a part of the primary key).
- A relation is in third normal form if it is in second normal form and if the only determinants it contains are candidate keys. (Note: any attribute that determines another attribute is called a determinant).