Professional Documents
Culture Documents
UNIT 18
Etinosa Enomayo
2
Entities:
An entity is a single thing person, place or thing that is independent from another. The information
stored about the real world are entities. In general, it is a thing that exist as a distinct and separate
thing. However, in databases an entity refers to a specific record or object that contains data about a
particular person or thing.
3
Field data: The kind of information kept in this attribute field. An example of how it would
look like “CustomerID (numeric, size=10): Unique identifier for each customer”.
Field Label: A word or phrase assigned to the field. For example, “CustomerID (numeric,
size=10): Unique identifier for each customer” here the field label would be the customer ID.
Field Length: Maximum length for the field's data. For example, “CustomerID (numeric,
size=10): Unique identifier for each customer” here the field length would be “size=10”
meaning it can store up to 10 characters.
Field sequence number: the order in which this field appears in the attribute. For example,
the table might be “LineNumber (numeric, size=10): Sequence number for each line item on
the sales order” the field value for the “LineNumbers” might be: 1,2,3,4
The primary key may be used, for instance, to identify the streets where the houses were located if
the data in the rows included house numbers.
4
To be recognised as a primary key, it is the data in each column that must be different, and not the
column name themselves. On top of that there can be no blank value or Null in the columns
Foreign key
The accuracy and reliability of data and the consistency as well as updating the data are all made
possible through the foreign key. While the primary key ensures that such data is distinct in a single
column, the foreign key restrictions guaranteed referential integrity. This is done by forbidding the
entry of values which are not matching with the primary key of the associated table.
A one-to-many relationship: This relationship has one record on one side and zero, one, or many
records on the other. The most frequently utilised kind of relationship is this one. The one-to-many
relationship can become a many-one relationship due to the linked table. For instance, a mother can
bear multiple children, however a mother can also only be the mother of only one child.
A many-to-many relationship: Such relationship of this sort exists when every single record in the
first table can be associated to one or more records in the second table, as well as when a single
record in the second table can be associated with one or more records in the first table. Two one-to-
many relationships can be connected via something called a linking table and they can then be
considered as a many-to-many relationship. The primary keys of the other two tables are found in
the connecting table, this is what links the two tables.
The following 4 guidelines must be followed by a table for it to be in the First Normal Form:
The relational database model's key advantage is that it offers a simple method of representing data
and makes connected data points easily accessible with ease. Because of this, relational databases
have been most frequently employed by businesses that need to manage significant volumes of
structured data, such as those that need to track inventories, process transactional data, or log
application activity. Many more benefits come with relational databases, such as:
Referential Integrity
Referential integrity talks of how accurate and reliable the data within a relationship. In such
relationships the data is seen to be linked to two or more tables. This is done using a foreign key to
reference a primary key value and this means that it should be made sure that data on both sides of
the relationship is always kept functional.
Primary keys help ensure referential integrity by making sure that a link between two related tables
is established. It makes sure that there are no duplicate values and that each record in a table can be
identified. When building relationships in between tables, a foreign key is used to reference a
primary key in another table as this creates links that make sure the information is valid and
consistent. Foreign keys ensure that the data in one table corresponds to data in another.
A cascade refers to an action that is initiated by the database management system when a
referenced row in a table is updated or deleted. When a row in the referenced table is updated or
deleted, the automated DBMS will update or delete all the corresponding row in the referencing
table. This assists in the reduction of data inconsistencies.
8
During the design of a relational database errors such as poor entity relationship modelling can
happen because of incorrectly representing relationships between entities. This error can lead to
significant issues such as data redundancy, inconsistency, and difficulties in querying. A way to avoid
such an error is to use descriptive and consistent naming conventions for tables, columns and
relationships as this makes things easier to understand and prevent confusion.
Another error that can arise is incorrect data normalisation which happens when data is either over-
normalised or under-normalised. This can also lead to data fragmentation or data redundancy as
well. A way to reduce the likelihood of such error is thorough the use of surrogate keys such as auto-
incrementing integers, as primary keys instead of neutral keys like social security numbers or email
addresses.
Incomplete or inaccurate requirements is another possible error that can arise during the design
process of relational databases. This can lead database design that does not met the requirements
of the business or the users. A way to avoid such an error is to develop a conceptual data model that
will help seize the requirements that need to be met and plans out the entities and relationships
involved.
During the construction of a relational database error such as incorrect data entries can happen. For
example, due to human error during the entry of data inconsistency, inaccuracy of the data as well
as even missing data. A way to however avoid such an error is by providing good quality user training
to the user who will be responsible for those data entries.
Another error that could occur is data integration issues, incorrectly integrating data from a variety
of sources can cause data inconsistencies and/or data loss. However, a way to avoid this issue is by
utilising data integration tools to help simplify the process of integrating data. These tools tend to
include features like data mapping, transformation, and cleansing to ensure that data is integrated
accurately without any issues.
Lastly another error that can occur during the construction stage of relational databases is
compatibility issues. This occurs when other software or hardware components are not compatible
with the database leading to longer loud times, crashed and errors. A way to avoid such a problem is
by defining compatibility requirements for the database, this includes operating systems, hardware
and software that are needed to run the database. This will help avoid such an issue as it makes it
easier for the database to integrate with the other systems.
9
References:
1NF, 2NF, 3NF and BCNF in Database Normalization | Studytonight. (n.d.). Studytonight -
Best place to Learn Coding Online. https://www.studytonight.com/dbms/database-
normalization.php
Editor. (2022, April 11). 9 Common Pitfalls to Avoid During Database Design. AltexSoft.
https://www.altexsoft.com/blog/database-design-mistakes/
What are the different types of relationships in DBMS? (n.d.). AfterAcademy | Platform
for learning coding & software development. https://afteracademy.com/blog/what-
are-the-different-types-of-relationships-in-dbms/
What is Primary and Foreign Keys in Database (Purpose and Use). (“Purpose of Foreign
Keys in Databases - eukhost Blog”) (n.d.). Web Hosting Blog from eUKhost.
https://www.eukhost.com/blog/webhosting/what-the-use-of-primary-foreign-keys-in-
database/