COIT20247: Database Design and Implementation - Normalization Report

Verified

Added on  2022/11/14

|9
|928
|391
Report
AI Summary
This report details a database normalization assignment, adhering to Third Normal Form (3NF) principles. It begins by mapping an ERD into a set of relations, ensuring compliance with 3NF. The report then focuses on two selected relations, listing their functional dependencies and demonstrating their adherence to 3NF. The solution includes database queries to extract specific information, such as counting parcels by status, identifying unclaimed lost parcels, finding the customer with the highest total charges, identifying employees with no lost parcels, and searching for employees by name. Furthermore, the report highlights attractive features like join and sub-queries, as well as the use of database reports for data summarization. The report also includes an ERD mapping, data integrity constraints, and discusses database implementation aspects and the attractive and difficult features of the assignment.
Document Page
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Report
Database Normalization
Third Normal Form Relations
TlCustomer (FlCustomerID, FlCustomerName, FlStreet, FlCity, FlPostCode,
FlCustomerContactNum)
Primary Key FlCustomerID
TlEmployee (FlEmployeeID, FlEmployeeName, FlEmployeeStartDate)
Primary Key FlEmployeeID
TlParcel (FlParcelID, FlParcelWeightInGrams, FlFromStreet, FlFromCity, FlFromPostCode,
FlToStreet, FlToCity, FlToPostCode, FlDateCollected, FlParcelValue, FlCharges, FlStatus,
FlCustomerID, FlEmployeeID)
Primary Key ParcelID
FlCustomerID references TlCustomer (FlCustomerID)
FlEmployeeID references TlEmployee (FlEmployeeID)
TlDelivered (FlParcelID, FlDeliveredDate)
Primary Key FlParcelID
FlParcelID references TlParcel (FlParcelID)
TlReturned (FlParcelID, FlReturnedDate)
Primary Key FlParcelID
FlParcelID references TlParcel (FlParcelID)
TlLost (FlParcelID, FlLostEntryDate)
Primary Key FlParcelID
FlParcelID references TlParcel (FlParcelID)
TlClaim (FlClaimID, FlClaimLodgeDate, FlClaimSettledAmount, FlClaimPaidDate,
FlParcelID)
Primary Key FlClaimID
FlParcelID references TlLost (FlParcelID)
TlInvoice (FlInvoiceID, FlInvoiceAmount, FlInvoiceDate, FlParcelID)
Document Page
Primary Key FlInvoiceID
FlParcelID references TlParcel (FlParcelID)
Functional Dependency
Claim Table
FlClaimLodgeDate FlClaimID
FlClaimSettledAmount FlClaimID
FlClaimPaidDate FlClaimID
FlParcelID FlClaimID
Employee Table
FlEmployeeName FlEmployeeID
FlEmployeeStartDate FlEmployeeID
(Poolet A. M. 2019)
Document Page
Normalization Demonstration
TlClaim (FlClaimID, FlClaimLodgeDate, FlClaimSettledAmount, FlClaimPaidDate,
FlParcelID)
1. The rule of first normal form is that the table should not have any repeated group and the
table Claim is not containing any repeated group. So, the table Claim is in 1 NF.
2. The rule of second normal form is that there should be no partial dependency in the table.
In Claim table there is only one primary key which is not composite. All fields depend
upon it only. So, there is no partial dependency in the Claim table and that is why the
Claim table is in 2 NF.
3. The rule of third normal form is that there should be no transitive dependency in the
table. In Claim table all fields depend upon the primary key only. No field depends upon
any other field. So, there is no transitive dependency in the Claim table and that is why
the Claim table is in 3 NF.
TlEmployee (FlEmployeeID, FlEmployeeName, FlEmployeeStartDate)
1. The rule of first normal form is that the table should not have any repeated group and the
table Employee is not containing any repeated group. So, the table Employee is in 1 NF.
2. The rule of second normal form is that there should be no partial dependency in the table.
In Employee table there is only one primary key which is not composite. All fields
depend upon it only. So, there is no partial dependency in the Employee table and that is
why the Employee table is in 2 NF.
3. The rule of third normal form is that there should be no transitive dependency in the
table. In Employee table all fields depend upon the primary key only. No field depends
upon any other field. So, there is no transitive dependency in the Employee table and that
is why the Employee table is in 3 NF.
(Thakur D. n.d.)
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Database Implementation
ERD Mapping
Data Integrity
Parcel Table
Attribute Data type Integrity Constraint Error Message
FlStatus Varchar(20) Collected, Returned,
Lost, Delivered
Enter Collected,
Returned, Lost or
Delivered
FlParcelValue Number >0 Enter greater than 0
FlCharges Number >0 Enter greater than 0
FlDateCollected Date/Time <=Date() Enter date prior or
equal to the today’s
date
Document Page
Database Queries
Query 1
SELECT FlStatus, count(FlParcelID) AS NumberOfParcels FROM TlParcel GROUP BY
FlStatus;
Query 2
SELECT Count(FlParcelID) AS ParcelsNotClaimed FROM TlLost WHERE FlParcelID Not In
(Select FlParcelID from TlClaim);
Query 3
SELECT TOP 1 TlCustomer.FlCustomerID, TlCustomer.FlCustomerName,
TlCustomer.FlStreet, TlCustomer.FlCity, TlCustomer.FlPostCode,
TlCustomer.FlCustomerContactNum, sum(TlParcel.FlCharges) as TotalCharges FROM
TlCustomer INNER JOIN TlParcel ON TlCustomer.FlCustomerID=TlParcel.FlCustomerID
GROUP BY TlCustomer.FlCustomerID, TlCustomer.FlCustomerName, TlCustomer.FlStreet,
TlCustomer.FlCity, TlCustomer.FlPostCode, TlCustomer.FlCustomerContactNum ORDER BY
sum(TlParcel.FlCharges) DESC;
Document Page
Query 4
SELECT TlEmployee.FlEmployeeID, TlEmployee.FlEmployeeName,
TlEmployee.FlEmployeeStartDate, count(TlParcel.FlParcelID) AS NumberOfParcels FROM
TlEmployee INNER JOIN TlParcel ON TlEmployee.FlEmployeeID=TlParcel.FlEmployeeID
WHERE TlEmployee.FlEmployeeID not in (Select FlEmployeeID from TlParcel where
FlStatus='Lost') GROUP BY TlEmployee.FlEmployeeID, TlEmployee.FlEmployeeName,
TlEmployee.FlEmployeeStartDate;
Query 5
SELECT * FROM TlEmployee WHERE FlEmployeeName like '*Wheel*';
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Database Report
Implementation Report
Attractive Features
The assignment is containing so many attractive features. The most attractive features are-
Join Queries
I used inner join queries in the assignment hat are fetching information from more than one table.
Inner join is used to fetch records which satisfy the specified condition.
Sub Queries
Sub queries are used to show information from tables. It is made up with the combination of
more than one query in a systematic way.
Difficult Feature
Document Page
The most attractive feature in the assignment is database report.
Database Report
The database report is used to show the data summary. It is used to easily show the summarized
data in a very presentable view.
References
Thakur D. (n.d.). Database Normalization. Retrieved From:
http://ecomputernotes.com/fundamental/what-is-a-database/what-is-a-database-
normalization
Poolet A. M. (2019). SQL by Design: Why You Need Database Normalization. Retrieved From:
https://www.itprotoday.com/sql-server/failover-detection-utility-simplifies-availability-
group-failover-analysis
chevron_up_icon
1 out of 9
circle_padding
hide_on_mobile
zoom_out_icon
logo.png

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]