Professional Documents
Culture Documents
UNIT 18
Etinosa Enomayo
3
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.
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.
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.
5
The following 4 guidelines must be followed by a table for it to be in the First Normal Form:
Efficient updating: The SQL used by relational databases makes it easier to update data this
is as users can write a single query that can update multiple fields in the database due to this
it is far easier and faster to update data.
Searching: When searching for data within a relational database it is far easier this is
because of the data is organised into tables which make it easier to find specific pieces of
data.
Sorting: Due to SQL sorting in data easy and efficient within relational databases, this is as
SQL allow users to write queries that sort data in a variety of ways. For example, SQL queries
can be written to sort data in ascending order or descending order and by a specific field or
by multiple fields.
Reporting: Relational database allows for easy and quick reporting of data this is due to the
fact that users can custom queries and reports that can be used to either filter data,
aggregate data, and perform calculations on the data.
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.
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. 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.
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. 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.
Although there are many errors that can occur during the construction and design of a relational
database there are also practices that can help prevent these errors from occurring. For instance,
utilising automated tools for data Intergration and data validation can help avoid the incorrect
integration of the data and will help prevent data inconsistencies as well as data losses. Another
thing that can be done is have regular checks to ensure that any errors can be identified and
corrected. Lastly adhering to the database design and principles can also prevent and such errors.
7
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/