Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Higher Nationals in Computing

Unit 04: Database Design and Development


ASSIGNMENT 1

Learner’s name: Tran Quang Hien


ID: GCS210109
Class: GCS1003A
Subject code: 1622
Assessor name: NGUYEN TUAN DANG

Assignment due: Assignment submitted:


ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 4: Database Design and Development

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Tran Quang Hien Student ID GCS210109

Class GCS1003A Assessor name Nguyen Tuan Dang

Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand
that making a false declaration is a form of malpractice.

Student’s signature

Grading grid
P1 M1 D1
 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date:


Signature & Date:
Assignment Brief 1 (RQF)
Higher National Certificate/Diploma in Computing

Student Name/ID Number: Tran Quang Hien/GCS210109


Unit Number and Title: Unit 04: Database Design & Development
Academic Year: 2022
Unit Assessor: Nguyen Tuan Dang
Assignment Title: Database design
Issue Date: 6 June 2022
Submission Date:
Internal Verifier Name:
Date:

Submission Format:

Format:
● The submission is in the form of an individual written report. This should be written in a
concise, formal business style using single spacing and font size 12. You are required to
make use of headings, paragraphs and subsections as appropriate, and all work must be
supported with research and referenced using the Harvard referencing system. Please also
provide a bibliography using the Harvard referencing system.
Submission

● Students are compulsory to submit the assignment in due date and in a way requested by
the Tutor.
● The form of submission will be a soft copy posted on http://cms.greenwich.edu.vn/.
● Remember to convert the word file into PDF file before the submission on CMS.
Note:

● The individual Assignment must be your own work, and not copied by or from another
student.
● If you use ideas, quotes or data (such as diagrams) from books, journals or other sources,
you must reference your sources, using the Harvard style.
● Make sure that you understand and follow the guidelines to avoid plagiarism. Failure to
comply this requirement will result in a failed assignment.

1
Unit Learning Outcomes:

LO1 Use an appropriate design tool to design a relational database system for a substantial
problem

Assignment Brief and Guidance:

You are employed as a Database Developer for a large IT consultancy company. The company
has been approached by FPT Shop which is expanding due to the growth of the number of stores.
FPT Shop is currently facing difficulties in dealing with managing the database from all shops on
over country. It decided to develop a new database so that: users can register with their phone
numbers as IDs and order or rate, comment for their bought devices, shop managers can
take care for their stores and director board can view all data from all shops.
You are tasked to select one of those systems to develop database for FPT Shop. Your tasks are
to:
• Work with FPT Shop to find out about current requirements for each system
• Analyse the requirements and produce clear statements of user and system requirements.
• Design a relational database system using appropriate design tools and techniques
• Develop a fully functional relational database system, based on an existing system design.
• Test the system against user and system requirements.
• Produce technical and user documentation

Part 1 (Assignment 1)
Before you start the development process, your manager has asked you to produce a report for the
CEO of FPT, containing:
1. Clear statements of user and system requirements. The system must have at least 3 user
roles, including business processes and statistical reports for FPT Shop managers.
2. The design of the relational database system using appropriate design tools and
techniques. It should contain at least four interrelated tables.
You would prefer to produce a more detailed document, so you will produce a comprehensive
design for a fully functional system which will include interface and output designs, data
validations and cover data normalization.
Your manager would like on the report your assessment of the effectiveness of the design in
relation to user and system requirements.

2
Learning Outcomes and Assessment Criteria (Assignment 1):
Learning Outcome Pass Merit Distinction
LO1 P1 Design a relational M1 Produce a D1 Assess the
database system using comprehensive design effectiveness of the
appropriate design for a fully functional design in relation to
tools and techniques, system which includes user and system
containing at least interface and output requirements.
designs, data
four interrelated
validations and data
tables, with clear
normalisation.
statements of user and
system requirements.

3
Table Contents
Task 1 - Statements of user and system requirements (P1) ........................................................... 5
1. Introduction to database ........................................................................................................... 5
1.1 What is the database? .......................................................................................................... 5
1.2 Types of database ................................................................................................................. 5
2. Introduction to RDBMSs........................................................................................................... 9
2.1 What is the RDBMSs: .......................................................................................................... 9
2.2 Popular RDBMSs:.............................................................................................................. 10
2.3 Select the specific RDBMS to apply to given scenario .................................................... 16
3. Database Design based on the scenario .................................................................................. 17
3.1 Analyze the requirement ................................................................................................... 17
Task 2 – Design the relational database system (P1 – M1) .......................................................... 18
1. Logical Design .......................................................................................................................... 18
2. Physical Design ......................................................................................................................... 21
References ......................................................................................................................................... 23

4
ASSIGNMENT 1 ANSWERS
Task 1 - Statements of user and system requirements (P1)
1. Introduction to database
In a small company, network administrators or developers may also be database administrators
(DBAs). Larger companies may have dozens of DBAs who specialize in everything from design
and architecture to maintenance and development. It doesn't matter what part of IT you work in,
you'll have to store data at some point, and having a basic understanding of databases and how they
work is beneficial to almost everyone.
This instructional exercise will most likely provide you with a basic understanding of the subject.
We'll go over the fundamentals of what a data set is, the historical context of data sets, social data
sets, key concepts from segments to lines, different types of data sets, additional concepts to grasp,
and a quick overview of the major business frameworks available today.
Generally, there are no essentials to this instructional exercise other than fundamental computing
knowledge.
1.1 What is the database?
A database, in the broadest sense, is a coordinated assortment of information. All the more
explicitly, a data set is an electronic framework that permits information to be effectively gotten to,
controlled, and refreshed.
All in all, a database is involved by an association as an electronic method for putting away,
overseeing, and recovering data. The data set is one of the foundations of big business IT, and its
capacity to coordinate, process, and oversee data in an organized and controlled way is the way to
numerous parts of present-day business productivity.
Notwithstanding, databases go far past just putting away information. As we'll see later, the
intrinsic rationale and proficiency in how the information is put away and recovered can give a
staggeringly strong business apparatus to an association. This is particularly evident when data sets
are appropriately taken advantage of for their detailing and business insight capacities.\
1.2 Types of database
There are different types of databases utilized for putting away various assortments of information:

Figure 1: Types of Database


Source: https://www.javatpoint.com/types-of-databases
1.2.1 Centralized Database
The kind of database stores information in a concentrated data set framework. It comforts the

5
clients to get to put-away information from various areas through a few applications.
These applications contain the validation interaction to allow clients to get to information safely.
An illustration of a Centralized data set can be the Central Library which conveys a focal data set of
every library in a college.

Advantages of Centralized Database


• It has reduced the risk of data management by ensuring that data manipulation has no impact on
the core data.
• It manages data in a central repository, which ensures data consistency.
• It helps organizations establish data standards by improving data quality.
• It is less expensive because the data sets are handled by fewer vendors.

Disadvantages of Centralized Database


• The centralized database has a large size, which slows down data retrieval.
• Keeping such a large database system up to date is difficult.
• Any server failure will result in the loss of all data, which could be a significant loss.
1.2.2 Distributed Database
As opposed to a unified database system, information in disseminated frameworks is spread across
numerous data set frameworks inside an organization. Communication links link these database
systems together. End-users can easily access data with the help of such links. Apache Cassandra
and HBase are two examples of distributed databases.
A distributed database system can be further divided into:
•Homogeneous DDB: Database systems that use the same operating system, application process,
and hardware devices.
•Heterogeneous DDB: Database systems that run on a variety of operating systems and use a
variety of hardware devices.

Advantages of Distributed Database


• A distributed database allows for modular development, which means the system can be expanded
by adding new computers and connecting them to the distributed database.
• The data set will not be impacted if one server fails.

Disadvantages of Distributed Database:


• In a distributed database system, guaranteeing information straightforwardness and coordination
across various destinations frequently requires the utilization of costly programming.
• When database replication is used, many operations across multiple sites necessitate numerous
calculations and constant synchronization, resulting in significant processing overhead.
• Data integrity may be jeopardized when using database replication because data is updated at
multiple locations.

6
1.2.3 Relational Database
This database is built on the relational data model, which stores data in the form of rows (tuples)
and columns (attributes), which are then combined to form a table (relation). SQL is used in
relational databases to store, manipulate, and maintain data. Each table in the database has a key
that distinguishes the data from other tables. MySQL and Microsoft SQL Server are examples of
relational databases.

There are the following four generally known properties of a social model known as ACID
properties, where:
A stands for Atomicity: This guarantees the information activity will finish either with progress or
with disappointment. It follows the 'go big or go home' procedure. For instance, an exchange will
either be committed or will be cut off.
C stands for Consistency: When we perform any activity over data, it is important to consider
when the activity should be protected. For instance, the record balance when the exchange ought to
be right, i.e., it ought to stay monitored.
I stands for Isolation: There can be simultaneous clients for getting information simultaneously
from the data set. As a result, the separation of information should be maintained. For instance,
when numerous exchanges happen simultaneously, one exchange impact ought not to be apparent
to different exchanges in the data set.
D stands for Durability: It guarantees that once it finishes the activity and commits the
information, information changes ought to stay long-lasting.
1.2.4 NoSQL Database
Non-SQL is a database that can be used to store a wide variety of data sets. It is not a relational
database because it stores data in a variety of formats, not just tabular. It was created in response to
a surge in demand for existing applications. As a result, in response to the demands, NoSQL
presented a wide range of database technologies. A NoSQL database can be additionally
characterized into 4 types:
Key-value storage: It is the least difficult type of database storage where it stores each and
everything as a key (or trait name) holding its value, together.
Document-oriented Database: A database in which data is stored as a JSON-like document. It
helps engineers in taking care of data by using a comparative document-model association as used
in the application code.
Graph Databases: It is utilized for putting away immense measures of information in a graph-like
design. Most normally, informal communication sites utilize the graph database.
Wide-column databases: similar to social databases in terms of information. Instead of being
organized in lines, information is stored in massive columns.

Advantages of NoSQL Database


• It empowers great efficiency in the application improvement as putting away information in an
organized format isn't needed.
• It is a superior choice for overseeing and dealing with enormous informational collections.
• It gives high versatility.

7
• Clients can rapidly get information from the database through key-esteem.
1.2.5 Cloud Database
A kind of database where information is put away in a virtual climate and executed over the
distributed computing stage. It furnishes clients with different distributed computing
administrations (SaaS, PaaS, IaaS, and so on) for getting to the information base. There are various
cloud stages, however, the most ideal choices are:
• Amazon Web Services(AWS)
• Microsoft Azure
• Kamatera
• PhonixNAP
• ScienceSoft
• Google Cloud SQL
1.2.6 Object-oriented Databases
This kind of database utilizes the item-based information model methodology for putting away
information in the data set framework. The data is organized and stored as items, similar to the
articles used in the item-based programming language.
1.2.7 Hierarchical Databases
This kind of database stores information as parent-youngsters relationship hubs. Here, it puts
together information in a tree-like design.

Figure 2: Hierarchical Databases


Source: https://www.javatpoint.com/types-of-databases
1.2.8 Network Databases
The database normally follows the organization information model. Here, the portrayal of
information is as hubs associated through joins between them. Dissimilar to the various leveled
information base, it permits each record to have numerous youngsters and parent hubs to shape a
summed-up diagram structure.
1.2.9 Personal Database
Gathering and putting away information on the client's framework characterizes a Personal
Database. This database is fundamentally intended for a solitary client.

8
Advantages of Personal Database
• It is basic and simple to deal with.
• It consumes less extra room as it is little in size.
1.2.10 Operational Database
This kind of database makes and updates the data set progressively. It is fundamentally intended for
executing and taking care of the day-to-day information activities in a few organizations. For
instance, An association involves functional information bases for overseeing each day's exchanges.
1.2.11 Enterprise Database
Huge organizations or enterprises utilize this database for dealing with a gigantic measure of
information. It assists organizations with expanding and working on their effectiveness. Such a
database permits concurrent admittance to clients.

Advantages of Enterprise Database:


• Multi processes are legitimate over the Enterprise database.
• It permits executing equal inquiries on the framework.
2. Introduction to RDBMSs
2.1 What is the RDBMSs:
"Relational Database Management System" is an acronym for "Relational Database Management
System." A relational database management system, or RDBMS, is a database management system
designed specifically for relational databases. RDBMSes are thus a subset of DBMSes.
A relational database is one that uses rows and columns to store data in a structured format. This
makes finding and accessing specific values within the database a breeze. Since the qualities in each
table are connected with each other, it is classified as "social." Tables can likewise be connected to
each other. Because of the relational structure, queries can be run on multiple tables at the same
time.

Figure 3: RDBMS structure


Source: https://commons.wikimedia.org/wiki/File:RDBMS_structure.png
While a relational database portrays the type of database and RDBMS makes due, the RDBMS
alludes to the database program itself. The product executes questions on the data, including adding,
refreshing, and looking for values. A RDBMS may similarly give a visual depiction of the data.
For instance, it might display data in tables like a bookkeeping sheet, permitting you to view and try

9
and alter individual qualities in the table. Some RDBMS programs allow you to create frames that
make entering, changing, and erasing data easier.
The RDBMS class encompasses the majority of well-known DBMS applications. Models
incorporate Oracle Database, MySQL, Microsoft SQL Server, and IBM DB2. A portion of these
projects support non-relational databases, yet they are principally utilized for relational database
management.
Instances of non-relational databases incorporate Apache HBase, IBM Domino, and Oracle NoSQL
Database. These sorts of databases are overseen by other DBMS programs that help NoSQL, which
doesn't fall into the RDBMS classification.
2.2 Popular RDBMSs:
2.2.1 MySQL
MySQL is the world's most well-known free open source database management system and is
exceptionally famous in the application advancement process. Since MySQL is a rapid, stable, and
simple to-utilize database management system, moving, and working on numerous working systems
gives a huge system of exceptionally impressive utility functions. With rapid and security,
MySQL is appropriate for applications with admittance to databases on the Internet. Clients can
download MySQL free of charge from the landing page. MySQL has numerous renditions for
various working systems: Win32 adaptation for Windows, Linux, Mac OS X, UNIX, FreeBSD,
NetBSD, Novell Netware, SGI IRIX, Solaris, SGI IRIX, Solaris, SGI).

Figure 4: My SQL
Source: https://www.mysql.com/
Features of MySQL
MySQL is a relational database management system (RDBMS) that uses SQL (Structured Query
Language) queries to store information. It is quite possibly the most well-known language for
getting to and dealing with the records in the table. MySQL is open-source and free programming
under the GNU license. Prophet Company upholds it.
Coming up next are the main elements of MySQL:
• MySQL is a relational database management system or RDBMS. To access and interact with the
table's records, this database language relies on SQL questions.
• Easy to use: MySQL is simple to use. We need to get just the fundamental information on SQL.
We can create and interact with MySQL with the help of a few simple SQL explanations.
• It is secure: MySQL consists of a strong information security layer that shields sensitive
information from gatecrashers. Additionally, passwords are encoded in MySQL.
• Client-Server Architecture: MySQL follows the working of a client/server architecture. There is a

10
database server (MySQL) and arbitrarily numerous clients (application programs), which speak
with the server; that is, they can question information, and save changes.
• Free to download: MySQL is free to use so we can download it from MySQL's official website
without any expense.
Advantages of MySQL
• Reduced Total Cost of Ownership: MySQL is one of the most famous open-source data set
administration frameworks that permit you to oversee social information bases.
• Portability: MySQL is a cross-stage information base server. It can run on various stages like
Linux, Solaris, Windows, and so forth.
• Seamless Connectivity: There are different secure and seamless association systems accessible to
interface with the MySQL server. These associations incorporate named pipes, TCP/IP attachments,
and UNIX Sockets.
• Rapid Development and Round-the-Clock Uptime: MySQL accompanies the confirmation of
24x7 uptime and offers an extensive variety of high-accessibility arrangements, including specific
group servers and expert/slave replication designs.
• Data Security: MySQL is around the world perceived as the most dependable and solid database
the board framework utilized in famous web applications including WordPress, Drupal, Joomla,
Facebook, and Twitter.
2.2.3 Disadvantages of MySQL
MySQL database server has its hindrances. A portion of these hindrances has been made sense of
beneath.
• MySQL lower rendition (5.0 or less) doesn't uphold ROLE, COMMIT and put away
methodology.
• MySQL isn't as efficient when it comes to dealing with extremely large databases.
• MySQL doesn't deal with exchanges productively and it is inclined to information defilement.
• MySQL doesn't have a decent turn of events and troubleshooting device contrasted with different
databases.
• MySQL doesn't uphold SQL really look at limitations.
2.2.2 Oracle
Oracle database is a relational database management system. OracleDB, or simply Oracle, is
another name for it. It is created and advertised by Oracle Corporation. It was made in 1977 by
Lawrence Ellison and different specialists. It is one of the most well-known relational database
motors in the IT market for putting away, coordinating, and recovering information.
Oracle database was the main DB that was intended for big business matrix figuring and
information warehousing. Endeavor lattice processing gives the most adaptable and savvy method
for overseeing data and applications. It involves SQL questions as a language for collaborating with
the database

Figure 5: ORACLE

11
Source: https://commons.wikimedia.org/wiki/File:Oracle_Logo.svg
Features of Oracle

Figure 6: Oracle Features


Source: https://www.javatpoint.com/what-is-oracle
Oracle database manages data with the assistance of an open, complete, and incorporated approach.
Coming up next are highlights that total the interest for a strong database of the executives:
• Availability: It is never disconnected or inaccessible, implying that the database is available 24
hours a day, seven days a week. It gives high availability of information bases in view of the Oracle
Data Guard usefulness. This usefulness permits the utilization of the optional information base as a
duplicate of the essential data set during any disappointment. Thus, all ordinary cycles, for example,
reinforcements and fractional disappointments don't intrude on the information base from being
utilized.
• Security: Oracle has a system for controlling and getting to the database to forestall unapproved
access. Because of the Oracle Advanced Security features, it delivers a high level of security.. It
offers two answers for safeguard databases that are TDE (Transparent Data Encryption) and Data
Redaction. TDE upholds information encryption both at the source and after sending out. Redaction
is performed at the application level. Oracle has some other security highlights like Oracle Database
Vault controls client honors and Oracle Label Security.
• Scalability: It includes features like RAC (Real Application Cluster) and Portability, which allow
an Oracle database to scale up or down depending on use. It contains capabilities such as rolling
instance migrations, conducting upgrades, ensuring application continuity, quality of service
management, and more in a clustered environment.
• Performance: Oracle gives performance improvement devices, for example, Oracle Advanced
Compression, Oracle Database In-Memory, Oracle Real Application Testing, and Oracle TimesTen
Application-Tier Database Cache. Their principal objective is to further develop framework
performance to the most elevated conceivable level.
• Analytics: Oracle has the accompanying arrangements in the field of analytics:
- OLAP (Oracle Analytic Processing): It is an execution of Oracle for doing convoluted
analytical computations on business data.
- Oracle Advanced Analytics: It is a specialized mix of Oracle R Enterprise and Oracle Data
Mining that helps clients in deciding prescient plans of action through data and text mining,
as well as statistical data computation.
• Management: Oracle Multitenant is a database management solution that combines a single
container database with a number of pluggable databases in a consolidated architecture.

12
Advantages of Oracle
• Performance: Oracle has systems and rules that assist us with getting elevated degrees of
information base performance.
• Portability: The Oracle data set can be ported on all kinds of stages more than any of its rivals.
• Backup and Recovery: It is in every case better to take a legitimate backup of your whole
prophet online backup and recovery. The Oracle data set makes it simple to achieve recovery
rapidly by utilizing the.
• PL/SQL: One of the best advantages of utilizing the Oracle information base is to help PL/SQL
expand for procedural programming.
Disadvantages of Oracle
• Complexity: Oracle isn't prescribed to utilize when the clients are not actually keen and have
restricted specialized abilities expected to manage the Oracle Database. It is likewise not
encouraged to utilize on the off chance that the organization is searching for a data set with
restricted usefulness and simple to utilize.
• Cost: The cost of Oracle items is exceptionally high in contrast with different data sets. As a
result, clients are more likely to go for less expensive options such as MS SQL Server, MySQL, and
so on.
• Difficult to manage: Oracle data sets are many times considerably more mind-boggling and
difficult regarding the management of specific exercises.
2.2.3 Microsoft SQL Server
Microsoft SQL Server is a relational database management system (RDBMS) that upholds a wide
assortment of exchange handling, business knowledge, and examination applications in corporate
IT conditions. Microsoft SQL Server is one of the three market-driving database advancements,
alongside Oracle Database and IBM's DB2.
Like other RDBMS programming, Microsoft SQL Server is based on top of SQL, a normalized
programming language that database administrators (DBAs) and other IT experts use to oversee
databases and inquiry about the information they contain. SQL Server is attached to Transact-SQL
(T-SQL), an execution of SQL from Microsoft that adds a bunch of restrictive programming
expansions to the standard language.

Figure 7: My SQL Server


Source: https://www.sqlservertutorial.net/
Features of Microsoft SQL Server
• Accelerated Database Recovery (ADR).
• Intelligent Query Processing Enhancements.
• Memory-optimized Tempdb metadata.
• Query Store custom capture policies.

13
• Always Encrypted with secure enclaves.
Advantages of Microsoft SQL Server
• Increases data security: One of the basic roles of Microsoft SQL Server is guaranteeing the
security of your database, particularly with a Microsoft SQL Server database administration service.
• Ease of configuration: Unlike other databases the board software, the establishment and
configuration of Microsoft SQL Server are more straightforward.
• Optimized data storage: This permits you to oversee data effectively and productively with
negligible investigating and support.
• Data recovery support: For the situation of force interference or server closures, data might
become debased. Microsoft SQL Server kills the gamble of losing data by having highlights for
data recovery and reclamation.
Disadvantages of Microsoft SQL Server
• Restricted compatibility: Making extra interest in Microsoft programming might be required
assuming that your business utilizes practically no Microsoft foundation. These additional
responsibilities could likewise cost your organization more, however, they will permit you to utilize
Microsoft SQL Server on your foundation.
• Hardware restrictions: Newer adaptations of Microsoft SQL Server need cutting-edge innovations
to run. Thus, in the event that your hardware comprises for the most part of more seasoned
hardware, you could have to put resources into fresher machines to utilize Microsoft SQL Server.
Besides, on the off chance that your business needs a bigger database, you likewise need to expand
your hard drive space.
• Cost: There is a free rendition of Microsoft SQL Server that you can utilize. Yet, for further
developed database applications and elements, you should make sizable speculation for higher
variants of the product.
2.2.4 PostgreSQL
PostgreSQL is an open-source database system that is designed for corporate use. It upholds both
SQL and JSON for relational and non-relational questions for extensibility and SQL consistency.
PostgreSQL upholds progressed data types and execution improvement features, which are just
accessible in costly business databases, similar to Oracle and SQL Server. It is otherwise called
Postgres. It is supported by an accomplished local area of engineers who have made enormous
commitments to make it a profoundly solid DBMS system.

Figure 8: PostgreSQL
Source: https://www.ovhcloud.com/asia/public-cloud/postgresql/
Features of PostgreSQL
• Assists engineers with building applications.
• Viable with different stages utilizing every significant language and middleware.
• It offers the most refined locking system.
• Support for multi-adaptation simultaneousness control.

14
• Mature Server-Side Programming Functionality.
• It permits managers to fabricate a fault-tolerant climate by safeguarding information uprightness.
Advantages of PostgreSQL
• PostgreSQL can run dynamic sites and web applications as a LAMP stack choice.
• PostgreSQL's write-ahead logging makes it a profoundly issue lenient data set.
• PostgreSQL source code is unreservedly accessible under an open-source permit. This allows you
the opportunity to utilize, adjust, and execute it as the need might arise.
• PostgreSQL upholds geographic articles so you can involve it for area-based administrations and
geographic data frameworks.
• PostgreSQL upholds geographic articles so it very well may be utilized as a geospatial
information store for area-based administrations and geographic data frameworks.
• To learn Postgres, you don't require a lot preparing as it's not difficult to utilize.
• Low maintenance and administration for both installed and undertaking utilization of PostgreSQL.
Disadvantages of PostgreSQL
• Postgres isn't claimed by one association. Along these lines, it experiences experienced issues
getting its name out there regardless of being completely included and tantamount to other DBMS
frameworks
• Changes made for speed improvement require more work than MySQL as PostgreSQL centers
around similarity
• Many open source applications support MySQL, however, may not help PostgreSQL
• On execution measurements, it is slower than MySQL.
2.2.5 MongoDB
MongoDB is a document-oriented NoSQL database utilized for high volume information capacity.
Rather than involving tables and columns as in the conventional relational databases, MongoDB
utilizes assortments and documents. Documents comprise key-esteem matches which are the
essential unit of information in MongoDB. Assortments contain sets of documents and capacities
which is what could be compared to relational database tables. MongoDB is a database that came to
light around the mid-2000s.

Figure 9: MongoDB
Source: https://www.mongodb.com/
Features of MongoDB
• Every database contains assortments which thus contains records. Each record can be different
with a shifting number of fields. The size and content of each record can be not quite the same as
one another.
• The record structure is more in accordance with how designers develop their classes and items in
their particular programming dialects. Designers will frequently say that their classes are not lines
and sections but rather have an unmistakable construction with key-esteem matches.

15
• The lines (or records as brought in MongoDB) don't have to have a pattern characterized ahead of
time. All things considered, the fields can be made on the fly.
• The information model accessible inside MongoDB permits you to address various leveled
connections, store clusters, and other more complicated structures all the more without any
problem.
• Scalability - The MongoDB conditions are entirely versatile. Organizations across the world have
characterized groups with some of them running 100+ hubs with around a great many reports inside
the database.
Advantages of MongoDB
• It is extremely simple to download and set up MongoDB.
• The extremely essential feature of MongoDB is that it is a schema-less database. No schema
movements any longer. Since MongoDB is without schema, your code characterizes your schema.
• The capacity to determine a record-based information model is one of the most appealing benefits
of MongoDB. Since, the manner in which it stores the information as BSON (Binary JSON), ruby
hashes, and so on, it can store a lot of data while still being able to handle clusters and different
reports.
• The report question language upheld by MongoDB assumes an essential part in supporting
powerful questions.
• Exceptionally simple to scale.
• Because of the organizing (BSON format - key-value pair) method of the information in
MongoDB, no mind-boggling joins are required.
Disadvantages of MongoDB
• Joins not Supported: MongoDB doesn't uphold joins like a relational database. Anyway, one can
use joins convenience by adding by coding it genuinely. Notwithstanding, it could slow execution
and impact execution.
• High Memory Usage: MongoDB stores key names for each worth pair. Additionally, because of
no usefulness of joins, there is data overt repetitiveness. This outcome in expanding pointless usage
of memory.
• Limited Data Size: You can have a report size, not more than 16MB.
• Limited Nesting: You cannot play out the nesting of archives for in excess of 100 levels.
2.3 Select the specific RDBMS to apply to given scenario
We can see that Microsoft SQL Server successfully responds to the necessities of the assignment
script based on tables and functions, advantages, and disadvantages. For the accompanying reasons:
• Installation Is Streamlined: It can be introduced through an arrangement wizard and the
prerequisite updates are distinguished and downloaded by the installer consequently. The intricacy
of introducing the product is limited essentially in light of the programmed installation of updates.
Other components, for example, logical and information base administrations can be introduced
independently a short time later. Programmed updation additionally decreases support costs
essentially.
• Security Features Are Better: SQL Server utilizes Policy-Based Management to identify security
arrangements that are resistant. This feature permits just approved workforce admittance to the
database. Security reviews and occasions can be composed naturally to log records.

16
• Enhanced Performance: The MS SQL server has an underlying transparent data compression
feature alongside encryption. Clients don't have to adjust programs to encode the data. The MS
SQL server approaches control combined with productive consent management devices. Further, it
offers enhanced performance with regard to data assortment.
• Lower Cost Of Ownership: SQL server incorporates compelling data management and data
mining instruments alongside plate parceling. Your server's ideal support can be guaranteed by
following compelling data management rehearses. These practices additionally assist you with
guaranteeing the accessibility and recoverability of data.
3. Database Design based on the scenario
3.1 Analyze the requirement
To have the option to plan a database as per the prerequisites of the article, I use the Microsoft SQL
Server database. This plan depends on the solicitation of FPT Shop.
In this database configuration article, there are 5 tables, each with various substances to meet the
prerequisites of the article. The five panels include:
• The Category Table is utilized to show every product classification with the goal that FPT Shop is
not difficult to control and clients can undoubtedly track down it.
• Product table: shows all data connected with the product.
• Manufacturer table: contains the data of the manufacturer that made the product.
• Comments panel: so purchasers can rate the product.
• User table: contains all data about product purchasers.

17
Task 2 – Design the relational database system (P1 – M1)
1. Logical Design

Figure 10: Logical Design


The relational Schema
Director (DirectorName, DirectorID, DirectorRole)
Store (StoreAddress, StoreInformation, StoreContact)
Manager (ManagerID, ManagerName, ManagementFacility, ManagerContact)
Product (ProductID, ProductName, ProductInformation)
Customer (CustomerName, CustomerID, CustomerAddress, CustomerPhone)
Comment (CommentVote, CommentFeedback, CommentID)
To handle students' career internships, I built a relational database called FPTShop using Microsoft
SQL .
Server and 3 normalization strategies (NF 1, NF 2 and NF 3). The index contains the following six
tables of relationships.

18
Director (DirectorID nvarchar(20), DirectorName nvarchar (30), DirectorRole nvarchar (20))
Store (StoreAddress nvarchar(50), StoreInformation nvarchar(100), StoreContact nvarchar(50))
Manager (ManagerID nvarchar(20), ManagerName nvarchar(30), ManagerFacility nvarchar(50),
ManagerContact nvarchar(50))
Product (ProductID nvarchar(20), ProductName nvarchar (30), ProductInformation nvarchar(100))
Customer (CustomerID nvarchar(20), CustomerName nvarchar(30), CustomerPhone int,
CustomerAddress nvarchar(50))
Comment (CommentID nvarchar(20), CommentVote int, CommentFeedback nvarchar(100))

We should verify that the six tables above are in the 3rd NF because: - They are not in the UNF
(Unclassified sample).
UNF Description: A table that represents one or more duplicate classes.
-That's in NF 1 (First Standard Sample).
NF 1 description: The connecting box consists of one and only one name.
-They are also in the 2nd form (Second standard form).
Description of 2nd NF: The table is the 1st NF and every feature that is not a primary key is
completely
based on the primary key-based function.
-They are also in the 3rd form (Third normal form).
Definition of the 3rd NF: The table is the 2nd NF and there are no non-primary key attributes that
are
excessively dependent on the primary key.
The Director table includes the following attributes:
- DirectorID is the director's number. It is stored up to 20 characters. It is also a primary key that
uniquely identifies all Director table
information.
- DirectorName is the name of the director. It is stored up to 30 characters.
- DirectorRole is the role of the director. It is stored up to 10 char
The Director Table is in the 3rd NF because all non-primary properties are completely and directly
dependent on the PK:
DirectorID → DirectorName
DirectorID → DirectorRole
Store table contains the following properties:
- StoreAddress is the address of the store. It is store up to 50 characters. It is also a key that
uniquely identifies all Product table information.
- StoreInformation is the information of the store. It is stored up to 100 characters.
- StoreContact is the store’s contact information. It is stored up to 50 characters.
The Store table is in the 3rd NF because all non-prime properties are completely dependent and
completely on PK:

19
StoreAddress → StoreInformation
StoreAddress → StoreContact
The Manger table contains the following properties:
- ManagerID is the manager's number. It is stored up to 20 characters. It is also a unique key that
uniquely identifies all Manager table information.
- ManagerName is the full name of the manager. It is stored up to 30 characters.
- ManagementFacility is the place that the manager oversees. It is stored up to 50 characters.
- ManagerContact is the manager's contact information. It is stored up to 50 characters.
The Manager table is in the 3rd NF because all non-primary properties are completely and directly
dependent on the Primary Key (PK):
ManagerID → ManagerName
ManagerID → ManagementFacility
ManagerID → ManagerContact
Product table contains the following properties:
- ProductID is the product code. It is stored up to 20 characters. It is also a key that uniquely
identifies all Product table information.
- ProductName is the name of the product. It is stored up to of 30 characters.
- ProductInformation is all the information of the product. It is stored up to 100 characters.
The Product table is in the 3rd NF because all non-prime properties are completely dependent and
completely on PK:
ProductID → ProductName
ProductID → ProductInformation
Customer table contains the following properties:
- CustomertID is the customer code. It is stored up to 20 characters. It is also a key that uniquely
identifies all Product table information.
- CustomerName is the name of the customer. It is stored up to of 30 characters.
- CustomerPhone is the number of the customer phone number. It is stored as an int.
- CustomerAddress is the address of the customer. It is store up to 50 characters.
The Customer table is in the 3rd NF because all non-prime properties are completely dependent and
completely on PK:
CustomertID → CustomerName
CustomertID → CustomerPhone
CustomertID → CustomerAddress
Comment table contains the following properties:
- CommentID is the id of the customer who comment. It is stored up to 20 characters. It is also a
key that uniquely identifies all Product table information.
- CommmentVote is the point customer rate, from 1 to 5. It is stored as an int.
- CommentFeedback is the feedback of the customer after evaluation. It is stored up to 100
characters.

20
- CommentImage is the pictures after the customer received the product. It is store as an image.
The Comment table is in the 3rd NF because all non-prime properties are completely dependent and
completely on PK:
CommentID → CommmentVote
CommentID → CommentFeedback
2. Physical Design

Figure 11: Physical Design


• Explanation

Table Name Fields Data type Constraint

DirectorID Nvarchar(20) Primary Key

DirectorName Nvarchar(30) Not null


Director
DirectorRole Nvarchar(20) Not null

StoreAddress Nvarchar(50) Primary Key

Store 21
StoreInformation Nvarchar(100) Not null

StoreContact Nvarchar(50) Not null

OperatorsID Nvarchar(20) Not null

ManagerID Nvarchar(20) Primary Key

ManagerName Nvarchar(30) Not null


Manager ManagementFacility Nvarchar(50) Not null

ManagerContact Nvarchar(50) Not null

ProductID Nvarchar(20) Primary Key

ProductName Nvarchar(30) Not null

ProductInformation Nvarchar(100) Not null


Produkt
ManagerID Nvarchar(20) Not null

BuyersID Nvarchar(20) Not null

CustomerID Nvarchar(20) Primary Key

CustomerName Nvarchar(30) Not null

Customer CustomerPhone Int Not null

CustomerAddress Nvarchar(50) Not null

CommentID Nvarchar(20) Not null

CommentID Nvarchar(20) Primary Key

Comment CommentVote Int Not null

CommentFeedback Nvarchar(100) Not null

22
References
ANONYMOUS. 8th August 2020. Types of Databases [Online]. Javatpoint. Available:
https://www.javatpoint.com/types-of-databases [Accessed 5th June 2022].
ANONYMOUS. 17th December 2015. What is Oracle? [Online]. Javatpoint. Available:
https://www.javatpoint.com/what-is-oracle [Accessed 10th June 2022].
ANONYMOUS. 24th November 2020a. What Is a Database? [Online]. Oracle. Available:
https://www.oracle.com/database/what-is-database/ [Accessed 7th June 2022].
ANONYMOUS. 24th November 2020b. Why Use MongoDB and When to Use It? [Online].
Internet Archive. Available:
https://web.archive.org/web/2021*/https://www.mongodb.com/why-use-mongodb
[Accessed 14th June 2022].
BRUSH, K. 23th March2022. RDBMS (relational database management system) [Online].
TechTarget. Available:
https://www.techtarget.com/searchdatamanagement/definition/RDBMS-relational-database-
management-system [Accessed 6th June 2022].
HUGHES, A. 2nd March 2022. Microsoft SQL Server [Online]. TechTarget. Available:
https://www.techtarget.com/searchdatamanagement/definition/SQL-Server [Accessed 9th
June 2022].
MOORE, L. 1st April 2022 MySQL [Online]. TechTarget. Available:
https://www.techtarget.com/searchoracle/definition/MySQL [Accessed 8th June 2022].
PETERSON, R. 23th September 2020 What is PostgreSQL? Introduction, Advantages &
Disadvantages [Online]. Guru99. Available: https://www.guru99.com/introduction-
postgresql.html [Accessed 12th June 2022].
YIPPEEE25. 30th September 2020. RDBMS Full Form [Online]. geeksforgeeks. Available:
https://www.geeksforgeeks.org/rdbms-full-form/ [Accessed 15th June 2022].

23

You might also like