Assignment DDD
Assignment DDD
Assignment DDD
ASSIGNMENT NUMBER: 1
Internal verification:
Table of Contents
I. INTRODUCTION.....................................................................................................................4
II. SYSTEM REQUIREMENTS.......................................................................................................4
1. Real-world scenario...........................................................................................................4
2. Data requirements for storage..........................................................................................5
3. Relationship between entities.........................................................................................11
III. DATABASE DESIGN...........................................................................................................13
1. Entity relationship diagram (ERD)....................................................................................13
2. Convert ERD Diagram to Relation Diagram.....................................................................13
3. Normalization...................................................................................................................14
4. Relational database system.............................................................................................15
I. 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 construction 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.
This is the simplest form with almost no protection for data integrity and security and often
contain redundancy.
Organized in tree-like structures, have same problems of redundancy, data integrity, and
comparability of data.
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
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.
Pros Cons
- 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
- Difficult to maintain
Handling a huge amount of data and good - Functionality heavily depends on add-ons
- data management.
-
Can work with other DBMSs like DB2, Oracle,
etc.
Customizable
Pros Cons
- Fast, stable and reliable - Enterprise editions is extremely expensive
- Provides excellent tools - Only run on Windows-based servers
- Easy to set up - Compatibility issues with applications running
- Work well with other MS products on non-Windows platforms
- Different editions available
- Great support for XML
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.
Pros Cons
- Fast, stable and convenient - Cost may be infeasible for small organizations
- Proven technology - Difficult to learn and use
- Latest innovations and features - Need specialized skills to install and maintain
- Exceedingly powerful tools - Require significant resources
- Available in a variety of versions
P2. Develop the database system with evidence of user interface, output
and data validations, and querying across multiple tables.
1. Real-world scenario
- 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.
- There are many tools for drawing ERD. I use the ERDPlus.com system to plot the ERD
diagram.
- My ERD:
Relation Diagram là gì? Convert ERD sang Relation Diagram để làm gì?
3. Normalization
a. Design Database.
DBMS Definition
A Database Management System (DBMS) is software designed to store, retrieve, define, and manage
data in a database.
Có các hệ quản trị cơ sở dữ liệu nào? Kể tên, có thể nói về ưu/nhược điểm và sau đó chọn hệ QT nào
để làm (SQLSERVER)
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 constraints 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:
Information is filtered data that has been made systematic and useful, and is considered to be more
reliable and valuable to researchers as proper analysis and refinement has been conducted. A DBMS is
concerned with the manipulation of data in a database.
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.
A distributed database management system (DDBMS) refers to a centralized application that functions
to create and manipulate distributed databases, synchronize the database at regular intervals and
provide transparent access mechanisms to the user, ensure universal application of data
modifications, maintain data security and integrity of the database, can be accessed by several users
simultaneously, and is used in applications that process large volumes of data.
A traditional file system is inexpensive, ideal for a small system with smaller quantity of parts, very low
design efforts, isolated data, and has a simple backup system, but is not secure, has a lack of flexibility
and many limitations, and has integrity flaws.
The benefits of DBMS over a traditional file system include: good for large systems, data-sharable,
flexible, has data integrity, and has a complex backup system. DBMS data security requirements
leverage the use of masking, tokenization, encryption, access control lists, permissions, firewalls, and
virtual private networks, making data storage and querying in DBMS a far more secure option than in a
traditional file system.
b. Database Diagram:
c. Implement a query language
After design my database, I use DDL to create my database:
Example: I use DDL create employee table
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
https://www.techopedia.com/definition/1221/normalization