Professional Documents
Culture Documents
ASSIGNMENT NUMBER: 1
Internal verification:
Contents
INTRODUCTION........................................................................................................................................4
P1. Design a relational database system using appropriate design tools and techniques, containing at
least four interrelated tables, with clear statements of user and system requirements..........................4
I. Data and database definition...........................................................................................................4
1.1. Flat file databases......................................................................................................................4
1.2. Hierarchical Databases..............................................................................................................5
1.3. Relational Databases.................................................................................................................5
2. Database Management System...................................................................................................6
2.1. Common Databases Management Systems...............................................................................9
P2. Develop the database system with evidence of user interface, output and data validations, and
querying across multiple tables..............................................................................................................12
II. SYSTEM REQUIREMENTS................................................................................................................12
1. Data requirements for storage...................................................................................................12
2. Data requirements for storage...................................................................................................12
3. Relationship between entities....................................................................................................15
III. DATABASE DESIGN......................................................................................................................16
1. Entity relationship diagram (ERD)...............................................................................................16
2. Convert ERD Diagram to Relational Schema...............................................................................17
3. Normalization.............................................................................................................................18
4. Relational database system........................................................................................................18
IV. REFERENCES................................................................................................................................28
INTRODUCTION
This is about the database management system. In here we have to create a database in a
proper way for the company called “AGC Company”. And it is a private firm in Vietnam. So in
this assignment, first we discussed the data models and their benefits and disadvantages.
Then explain about different types of technologies useful for the databases. After that, we
have identified the attributes, entities, cardinalities, and all, with the scenario and draw ER
Diagram for the company.
We created this database using SQL Server Management Studio use for creating management
reports for the company. We already added relational schema. And also we added a User
manual for how to use the database, the testing part is already done. In the final task, we
discussed how to verification and validation address to the database and some details about
access rights for the users.
P1. Design a relational database system using appropriate design tools and techniques,
containing at least four interrelated tables, with clear statements of user and system
requirements.
This is the simplest form with almost no protection for data integrity and security and
often contain redundancy.
1.2. Hierarchical Databases
Data is organized in tables that are related to each other. Each table has one or more
columns assigned as primary key.
1.4. Others
A Database Management System (DBMS) is software designed to store, retrieve, define, and
manage data in a database.
What is DBMS?
DBMS software primarily functions as an interface between the end user and the database,
simultaneously managing the data, the database engine, and the database schema in order to
facilitate the organization and manipulation of data.
Though functions of DBMS vary greatly, general-purpose DBMS features and capabilities
should include: a user accessible catalog describing metadata, DBMS library management
system, data abstraction and independence, data security, logging and auditing of activity,
support for concurrency and transactions, support for authorization of access, access support
from remote locations, DBMS data recovery support in the event of damage, and
enforcement of Disadvantage traits to ensure the data follows certain rules.
A database schema design technique that functions to increase clarity in organizing data is
referred to as normalization. Normalization in DBMS modifies an existing schema to minimize
redundancy and dependency of data by splitting a large table into smaller tables and defining
the relationship between them. DBMS Output is a built-in package SQL in DBMS that enables
the user to display debugging information and output, and send messages from subprograms,
packages, PL/SQL blocks, and triggers. Oracle originally developed the DBMS File Transfer
package, which provides procedures to copy a binary file within a database or to transfer a
binary file between databases.
A database management system functions through the use of system commands, first
receiving instructions from a database administrator in DBMS, then instructing the system
accordingly, either to retrieve data, modify data, or load existing data from the system.
Popular DBMS examples include cloud-based database management systems, in-memory
database management systems (IMDBMS), columnar database management systems
(CDBMS), and NoSQL in DBMS.
RDBMS vs DBMS
A relational database management system (RDBMS) refers to a collection of programs and
capabilities that is designed to enable the user to create, update, and administer a relational
database, which is characterized by its structuring of data into logically independent tables.
There are several features that distinguish a Relational DBMS from a DBMS, including:
Other data models include entity-relationship, record base, object-oriented, object relation,
semi-structured, associative, context, and flat data models. Database system architecture in
DBMS is categorized as either single tier, in which the DBMS is the only entity where the user
directly sits on the DBMS and uses it, or multi-tier, in which nearly all components are
independent and can be changed independently.
2.1.1. MySQL
MySQL is an open source relational database management system (RDBMS) that runs on a
server and is usually used for developing web-based software applications. It provides a very
fast, multithreaded and powerful SQL database server. PHP is often used along MySQL for
cross-platform applications.
Advantage Disadvantage
- Available for free - No built-in support for XML or OLAP
- Supports standard SQL - Need to pay for support
- Fast, reliable and easy to use - Difficult to debug
- Handling a huge amount of data and - Difficult to maintain
good data management. - Functionality heavily depends on add-
- Can work with other DBMSs like DB2, ons
Oracle, etc.
- Customizable
2.1.3. Oracle
Oracle is one of the leading SQL relational database management systems that is
commonly used for running online transaction processing (OLTP), data warehousing (DW) and
mixed (OLTP & DW) database workloads. It is designed for the cloud and supports
single/multiple server hosting. Oracle allows control over an immensely huge amount of data
with the help of latest features.
Advantage Disadvantage
- Fast, stable and convenient - Cost may be infeasible for small
- Proven technology organizations
- Latest innovations and features - Difficult to learn and use
- Exceedingly powerful tools - Need specialized skills to install and
- Available in a variety of versions maintain
- Require significant resources
P2. Develop the database system with evidence of user interface, output and data
validations, and querying across multiple tables.
AGC_Account AGC_BillInfo
AGC_Customer AGC_BillProduct
AGC_Employee AGC_Order
AGC_Categories AGC_ImportProduct
AGC_Product
Decription
Entity Attribute Description of Atribute
Entity
Account_Username This is the unique username in
the company
All account in Account_Password It is the password used to log
AGC company into the system.
AGC_Account
Account_Type Decentralization of accounts in
the company
AGC_Customer Customer_ID It is the unique identifier for a
customer type
Customer_Name This is the full name of the
customer
Company_Name This is the Company name of
the customer
Company_Address This is the Company's address
All customer in
Contact_Phone This is the phone number
AGC company
Company to contact
Contact_Email This is the email to contact the
company
Customer_Username This is the unique username in
the company
Employee_ID It is the unique identifier for a
employee type
All of the Employee_Name It is the full name of each
company's employee type.
employee BirthDate This is the employee's birthday
- Product - Category:
o A category will have many products. A product belongs to one category. So, the
relationship between category and product is the One - Many relationships.
- Product - Supplier:
o A supplier will have many products. A product belongs to one supplier. So, the
relationship between product and supplier is the One - Many relationships.
- Invoice - Employee:
o An employee will have many invoices. An invoice belongs to one employee. So,
the relationship between employee and invoice is the One - Many
relationships.
- Invoice - Customer:
o A customer will have many invoices. An invoice can only belong to one
customer. So, the relationship between customer and invoice is the One -
Many relationships.
- Import - Employee:
o An employee will have many import invoices. An import invoice belongs to one
employee. So, the relationship between employee and invoice is the One -
Many relationships.
- Import - Supplier:
o A customer will have many import invoices. An invoice can only belong to one
supplier. So, the relationship between supplier and import is the One - Many
relationships.
Definiton: Relational Model represents how data is stored in database in the form
of table.
A relational schema for a database is an outline of how data is organized. It can be
a graphic illustration or another kind of chart used by programmers to understand
how each table is laid out, including the columns and the types of data they hold
and how tables connect.
Here is my Relational Schema:
A. Database Diagram:
B. Implement a query language
After design my database, I use DDL to create my database:
Example: I use DDL create employee table
Create table AGC_Account
Select all the customers have the address “Ha Noi”.
Select name, phone number and address of the customers who have order on
2020-10-22.
Select all the product with the price higher than average.
Select customers with the invoice they have.
Select information of all import invoice of supplier with employee who created
the invoice.
Count the number of product supplied by each company
b. Insert
Insert into table customer
For example, your employee birthdate is later than date time then it
will caught error:
c. Update
Update customer username of the customer with ID = 1
d. Delete
Delete from table categories where category = 3
Before delete
After delete
IV. REFERENCES
- https://asq.org/quality-resources/relations-diagram#:~:text=Variation%3A%20matrix
%20diagram,that%20are%20not%20easily%20recognizable
- https://www.smartdraw.com/entity-relationship-diagram/
- https://www.sciencedirect.com/topics/computer-science/ternary-
relationship#:~:text=A%20ternary%20relationship%20is%20an,the%20semantics
%20of%20the%20association.
- https://www.omnisci.com/technical-glossary/dbms