| Relationship |
| Types of relationships |
- Bi-directional
- Binary
- Ternary
|
| A relationship can exist between only one entity type - this is known as the bill_of_materials relationship, but entity types may be linked in a number of relationships. Relationships are part of the overall data set. A relationship is also an entity. The set of relationships is a entity of a special kind. Finally, the relationship set is not exhaustive. |
| |
| Relational model overview |
The relational model is the most popular data model on which DBMS are built, others being the hierarchical and network models. At present there is no generally agreed object oriented model of data and different OODBMS products assume slightly differing data organisations. The basic model consists of three parts.
- Data structures called tables or relations.
- Integrity rules on allowable values and combinations of values in tables.
- Data manipulation operators which can be either the relational algebra or the relational calculus plus an assignment operator.
|
| It is important to note that the relational model is a paper based model and that not all of its features are implemented as relational database systems. |
| |
| Relational tables overview |
| A relational DBMS is a database where data is a collection of time-varying, normalized, independent relations of assorted degree and cardinalities. Each table or relation exists on domain D1 to DN and consists of |
- A set of attributes A1 to AN such that attribute Ai corresponds to domain Di
- A set of n-tuples or entries in the table.
|
| where 'n' in this case is the degree of the relation. Primary keys also exist on tables. |
| The entire information content of the database is represented as explicit data values each of which is atomic. There are no links or pointers connecting tables and thus the representation of relationships is as data in another table. An example is given. |
| |
| Relational integrity rules |
| There are two integrity rules associated with the relational model |
- Entity Integrity
- Referential Integrity
|
| These two rules are general rules which apply to every database that claims to conform to the relational model prescription and have to do respectively with primary keys and foreign keys. The rules refer to database states. There is nothing solid said about how to avoid incorrect database states and many commercial DBMS support stopping the execution of DB updates which would lead to violations of these states. |
| |
| Meaning of shared data. |
| By "shared data" we mean that individual pieces of data in the database may be shared among several different users who use it for different purposes. The users may have concurrent access, but must be protected from each other using security mechanisms. |
| |
| What sharing data means. |
| Sharing data means application programs and users share the one copy of an enterprise data. Also, new applications can be developed on existing, already used data sets. In other words, it may be possible to satisfy the data requirements of new applications without having to create any additional stored data. |
| |
| Association relationships |
Association relationships exist between entity sets in an ER model. Different data models will differ in how they handle the association relationships (most handle attribute relationships in the same way). We can identify three main models for data, each with their own relative merits.
- Relational
- Hierarchical
- Network
|
| |
| Attribute Relationships |
| Attribute relationships exist between the attributes of the same type of entity. They describe the entity and are only of interest while the entity exists. Examples of attribute relationships would be the name, address and telephone number attributes of the person entity. |