Answer To: 1 | P a g e Unit ISY1002/ISY103 Database Management for Business Assessment Type Group Assignment –...
Shikha answered on May 31 2021
Student Name
Student ID 6
Database Implementation Report
(Australian Manufacturing Company (AMC))
Submitted By
Course
Professor
Date
Table of Contents
1. Introduction 3
1.1. Project Objective 3
1.2. DBMS Selection 4
1.3. Business Rules 4
2. PART A: ERD Diagram 5
3. PART B: Normalized Schema 6
4. PART C: Relational Schema 7
5. Database Schema 9
5.1. Table Design 9
6. Referential Integrity Constraint 14
6.1. Data Insertion 16
7. SQL Statements 20
8. PART E: Group Report 24
9. References 25
1. Introduction
Database as the name shows is the organized or systematic accumulation of information from which information can be retrieved and reviewed as and when required. It goes about as a repository or a storage facility of information and is continuously required by all the significant associations for having appropriate data and furthermore to monitor various operations occurring in it. It gives a back end support and encourages the best possible working of the progressive associations. Database can have various tables present inside it which are the group of rows and columns that are accessible to store the information. The information can be recovered from a single table or the multiple tables relying upon the user or the association's prerequisite. Database Management System gives us the best approach to deal with our data in an organized and efficient manner with the goal that it tends to be utilized adequately. It gives a powerful interface between the system and the user. (Gouhar, 2017).
According to given scenario, Australian Manufacturing Company (AMC) requires a database framework to deal with their stores, staff, items, providers, benefactors as well as orders. As a database administrator, my job is to develop and implement database system for AMC.
1.1. Project Objective
The main objective of implementing database in AMC is to automate all the processes in the organization by implementing centralized database system. Also, it will help to minimize the response time taken for querying the data from database. All the data will be managed and organized in an efficient way. The system will help the organization to easily retrieve the data according to particular criteria which will help to reduce the time taken to fetch the record.
1.2. DBMS Selection
There are many database engines available to store the data like Oracle, MySQL, SQL, Server but I will use MySQL for organizing the data. MySQL is a quick, reliable, powerful and open source database framework that embeds many features. Organization and security are successful and are effectively setup. MySQL would be recommend for AMC where preparing information to and from the database wasn't so huge. The unique storage engine architecture enables database experts to configure the MySQL database server explicitly for specific applications, with the final product being astonishing execution results. Regardless of whether the planned application is a fast value-based transactional framework or a high-volume site that administrations a billion queries per day, MySQL can meet the most requesting expectations for any framework. With high speed load utilities, distinctive memory caches, full content files, and other execution improving components, MySQL offers all the correct ammunition for the database system. MySQL offers outstanding security includes that guarantee supreme information insurance. As far as database confirmation, MySQL gives incredible systems to guaranteeing just authorized users can have access to the database server, with the capacity to block unauthorized users. (DBQuest, Inc., 2012).
1.3. Business Rules
The following business rules should be considered while implementing database system for AMC:
· The database must store all the data related to its stores, customers, employees, products, orders, and suppliers.
· There are two types of employees – Full time and part time and both employee’s salary details must be saved into the system.
· Pay slips will be generated for both employees on the basis of no of hours worked in a week.
· For a full time, it must store annual salary whereas for part time employees, it must store hourly rate of each employee.
· The database must be centralized as it must consist of data like which store has which product with what inventory.
· All the orders generated will be saved in the orders tables whereas orderdetails will consist of products ordered within each order.
2. PART A: ERD Diagram
3. PART B: Normalized Schema
In order to normalize above schema, entities must be in 1NF, 2NF and 3NF. We are taking the example of three entities – Customer, Order, Orderdetails.
1. Customer CustomerNo, FName, LName, Address, ContactNo, Email
Here, we have taken CustomerNo as primary key as we can't take FName, LName, Address, Email, ContactNo as primary key because all these attributes can be repetitive. So, in order to uniquely identify a customer, we should have unique CustomerNo as no two customers can have unique CustomerNo. Also, in above given functional dependency, no two customers can have repetitive ID. Therefore, this is in 1NF.
As we know that CustomerNo is primary key and can be only candidate key in above functional dependency as all other attributes of customer entity can be repetitive. Hence, the above relationship is single valued candidate key which shows that above FD is in 2NF.
Also, FName, LName can't be unique and cannot be used to find other attributes. We can say that the above entity has no transitive dependency which implies that above entity is in 3NF.
2. Order OrderNo, CustomerNo, OrderDate, StoreNo
Here, we have taken OrderNo as unique primary key as an order can only be identified by unique orderno. A customer can order many times on different dates from different stores. Therefore, CustomerNo, Orderdate and StoreNo can’t be unique. Therefore, above entity is in 1NF. Also, OrderNo can only be candidate key as all other attributes can be repetitive. Therefore, it is in 2NF. Now above entity is in 1NF, 2NF therefore, it is in 3NF.
3. OrderDetails ID, OrderNo, ProductNo, Qty
Here, we have taken ID as unique primary key as an order can have many products orders. Therefore, we have taken ID as primary key. Therefore, OrderNo, ProductNo and Qty can’t be unique. Therefore, above entity is in 1NF. Also, ID can only be candidate key as all other attributes can be repetitive. Therefore, it is in 2NF. Now above entity is in 1NF, 2NF therefore, it is in 3NF.
Hence, I have tried to take all above entities in 3NF with some primary key defined.
4. PART C: Relational Schema
Entity
Field Name
Data Type
Length
Key Constraint
Store
StoreNo
INT
AUTO INCREMENT
Primary Key, NOT NULL
Name
VARCHAR
50
Phone
VARCHAR
15
Email
VARCHAR
50
Address
VARCHAR
50
Employee
EmployeeNo
INT
AUTO INCREMENT
Primary Key, NOT NULL
FName
VARCHAR
30
LName
VARCHAR
30
Address
VARCHAR
50
Mobile
VARCHAR
15
Email
VARCHAR
50
TFN
VARCHAR
15
Salary
FLOAT
8,2
JoiningDate
DATE
EmployeeType
VARCHAR
20
Check (Full Time/ Part Time)
JobProfile
VARCHAR
50
StoreNo
INT
Foreign Key
Department
DepartmentNo
INT
AUTO INCREMENT
Primary Key, NOT NULL
Title
VARCHAR
10
StoreNo
INT
Foreign Key
Phone
VARCHAR
15
Email
VARCHAR
50
Supervisor
INT
Foreign Key
PaySlips
SlipNo
INT
AUTO INCREMENT
Primary Key, NOT NULL
EmployeeNo
INT
Foreign Key
Week
VARCHAR
10
Year
VARCHAR
5
NoOfHours
INT
GrossPay
Float
(8,2)
StoreNo
INT
Foreign Key
Supplier
SupplierNo
INT
AUTO INCREMENT
Primary Key, NOT NULL
Name
VARCHAR
50
Address
VARCHAR
50
ContactNo
VARCHAR
15
Email
VARCHAR
50
Product
ProductNo
INT
AUTO INCREMENT
Primary Key, NOT NULL
Name
VARCHAR
50
Brand
VARCHAR
50
Description
VARCHAR
100
SupplierNo
INT
Foreign Key
Storeno
INT
Foreign Key
Customer
CustomerNo
INT
AUTO INCREMENT
Primary Key, NOT NULL
Fname
VARCHAR
50
LName
VARCHAR
50
Mobile
VARCHAR
15
Address
VARCHAR
50
Storeno
INT
Foreign Key
Orders
OrderNo
INT
AUTO INCREMENT
Primary Key, NOT NULL
CustomerNo
INT
Foreign Key
OrderDate
Date
StoreNo
INT
Foreign Key
OrderDetails
ID
INT
AUTO INCREMENT
Primary Key, NOT NULL
OrderNo
INT
Foreign Key
ProductNo
INT
Foreign Key
QtyOrdered
INT
5. Database Schema
5.1. Table Design
1. Store
mysql> Desc Store;
+---------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+----------------+
| StoreNo | int(11) | NO | PRI | NULL | auto_increment |
| Name | varchar(50) | YES | | NULL | |
| Phone | varchar(15) | YES | | NULL | |
| Email | varchar(50) | YES | | NULL | |
| Address | varchar(50) | YES | | NULL | ...