Designing a Data Model for a Hotel Room Booking System
PDF | In this paper an Articulated Entity Relationship (AER) diagram is Moreover, ER diagrams are not designed by taking intoaccount the requirements of normalization. . Each step is having a name e.g. 1NF, 2NF and 3NF. upon accommodation of FD information as an integral part of the ER model. Translation of a (Normal Form) ER Diagram to a RDB. ❑ A Normal Form for ER .. then normalize the relations in the schema to at least 3NF. Step 4. Design a. A Entity Relationship Diagram showing 3NF. You can edit this Entity Relationship Diagram using Creately diagramming tool and include in your report/presentation /website. (12). E-R Diagram for Hotel management system. (10).
Note that every column has a data type varchar, integer, date, boolean to indicate what kind of values can be assigned to the column. For example, the column smoke on table room is boolean data type, meaning only true or false are the allowed values.
This column is called the primary key PKand best practices on database design suggest that every table must have a PK. If we take a look on the previous Vertabelo data model, we will see that every table has a column called id with a PK indicator on the right.
These id columns forms the PK as a convention we name id the PK column. In other words, every PK column has a unique constraint, and any attempt to create a new record with a duplicated value will be rejected with an error by the database manager. Continue Discovering; Find New Database Objects A reservation is one of the more complex elements to represent in this data model.
This business requirement adds 4 things to our model: A reference is a very important element in a data model. A reference describes how one table is related to another table. In our model, every room reserved belongs to one reservation, so we will use a reference to model that fact. This reference is graphically represented as a line connecting both tables. Moreover, as every reservation belongs to one guest, we need to create a new reference linking the guest and the reservation tables.
The updated data model is showed in the following diagram designed in Vertabelo: What Happens to the Tables Linked by a Reference? When we create a reference between two tables, one new column is added to one of the tables. This just added column is called a Foreign Key, and acts as a pointer to the other table allowing connections between tables. For example, take a look to the followings diagrams: Figure 5 Multi-valued dependency equivalency in ERD occurs when attributes within an entity instance have more than one value.
This is a situation when some attributes within an entity instance have maximum cardinality of N more than 1. When an attribute has multiple values in an entity instance, it can be setup either as a composite key identifier of the entity type, or split into a weak entity type.
For example, consider the following entity type Student Details as shown in Figure 6.
The composition of entity identifier is due to the fact that a student has multiple MajorMinor values along with being involved in multiple activities.
The multi-valued dependency affects the key structure. This means that a SID value is associated with multiple values of MajorMinor and Activity attributes, and together they determine other attributes. The entity instance of Student Details entity type is shown Figure 7. Each normal form rule and its application is outlined. First Normal Form 1NF The first normal form rule is that there should be no nesting or repeating groups in a table.
3nf | Editable Entity Relationship Diagram Template on Creately
Now an entity type that contains only one value for an attribute in an entity instance ensures the application of first normal form for the entity type. So in a way any entity type with an entity identifier is by default in first normal form.
For example, the entity type Student in Figure 2 is in first normal form. Second Normal Form 2NF The second normal form rule is that the key attributes determine all non-key attributes. A violation of second normal form occurs when there is a composite key, and part of the key determines some non-key attributes.
The second normal form deals with the situation when the entity identifier contains two or more attributes, and the non-key attribute depends on part of the entity identifier.
For example, consider the modified entity type Student as shown in Figure 8. The entity type has a composite entity identifier of SID and City attributes.
3nf ( Entity Relationship Diagram)
Figure 8 An entity instance of this entity type is shown in Figure 9. Now, if there is a functional dependency City? Status, then the entity type structure will violate the second normal form. Figure 9 To resolve the violation of the second normal form a separate entity type City with one-to-many relationship is created as shown in Figure The relationship cardinalities can be further modified to reflect organizational working.
In general, the second normal form violation can be avoided by ensuring that there is only one attribute as an entity identifier. This normal form is violated when there exists a dependency among non-key attributes in the form of a transitive dependency. For example consider the entity type Student as shown in Figure 4.
In this entity type, there is a functional dependency BuildingName? Fee that violates the third normal form. Transitive dependency is resolved by moving the dependency attributes to a new entity type with one-to-many relationship. In the new entity type the determinant of the dependency becomes the entity identifier. The resolution of the third normal form is shown in Figure The Boyce-Codd normal form rule is that every determinant is a candidate key.
Even though Boyce-Codd normal form and third normal form generally produce the same result, Boyce-Codd normal form is a stronger definition than third normal form.
Every table in Boyce-Codd normal form is by definition in third normal form. Boyce-Codd normal form considers two special cases not covered by third normal form: Part of a composite entity identifier determines part of its attribute, and a non entity identifier attribute determines part of an entity identifier attribute.
These situations are only possible if there is a composite entity identifier, and dependencies exist from a non-entity identifier attribute to part of the entity identifier.
For example, consider the entity type StudentConcentration as shown in Figure The entity type is in third normal form, but since there is a dependency FacultyName? MajorMinor, it is not in Boyce-Codd normal form. Figure 12 To ensure that StudentConcentration entity type stays in Boyce-Codd normal form, another entity type Faculty with one-to-many relationship is constructed as shown in Figure Figure 13 Fourth Normal Form 4NF Fourth normal form rule is that there should not be more than one multi-valued dependency in a table.
For example, consider the Student Details entity type shown in Figure 6.
3NF ( Entity Relationship Diagram)
Now, during requirements analysis if it is found that the MajorMinor values of a student are independent of the Activity performed by the student, then the entity type structure will violate the fourth normal form. To resolve the violation of the fourth normal form separate weak entity types with identifying relationships are created as shown in Figure The StudentFocus and StudentActivity entity types are weak entity types.
It is now presumed that the Student entity type has the functional dependency SID? Due to the similarity in the notion of an entity type and a relation, normalization concepts when explained or applied to an ERD may generate a richer model. Also, such an application enables a better representation of user working requirements. This application now results in the specification of additional guidelines for refining an ERD.
These guidelines can be stated as follows: There should be only one dependency in each entity type where the determinant is the entity identifier. There should not be any additional dependency among the non entity identifier attributes. Any such additional dependency should be represented by a new entity type with one-to-many relationship.
If there is a composite entity identifier of three or more attributes it should be ensured that there is only one multi-valued dependency among them. Study of dependencies among attributes during requirement analysis assist in entity type identifications and cardinality specifications.
Since an ERD represents a relational model schema, a normalization ERD improves the modeling effort thereby facilitating a better fit with organizational working. Enhancing the ER model with integrity methods. Journal of Database Management, 10 4Accuracy in modeling with extended entity relationship and object oriented data models.
Journal of Database Management, 4 4 Object-Oriented Analysis and Design with Applications second edition. On the satisfiability of dependency constraints in entity- relationship schemata.