Nguen le loi(bkc12205)-assignment 1 lan2-database and development Database (IT3292E) PROGRAM TITLE: BTEC in Computing UNIT TITLE: Unit 1:Database Design and Development ASSIGNMENT NUMBER: Assignment 1 ASSIGNMENT NAME: Database Design and Development SUBMISSION DATE: 14/4/2022 DATE RECEIVED: 14/4/2022 TUTORIAL LECTURER: NGUYEN QUANG HUY WORD COUNT:4879 STUDENT NAME:Nguyễn Lê Lợi STUDENT ID: BKC12205 MOBILE NUMBER: 0363074734 0 0 Summative Feedback: Internal verification: 0 0 Higher Nationals Assignment Brief – BTEC (RQF) Higher National Diploma in Computing Student Name/ID Number Unit Number and Title Unit 1: Programming Academic Year 2021 - 2022 Unit Tutor Nguyen Ngoc Tan Assignment Title Assignment BKC Issue Date Submission Date IV Name & Date Submission Format 1. 2. 3. Design with evaluations Presentation or Demonstration and evidence of testing of fully functional database Technical and User documentation Unit Learning Outcomes LO1 Use an appropriate design tool to design a relational database system for a substantial problem. LO2 Develop a fully functional relational database system, based on an existing system design. LO3 Test the system against user and system requirements. 0 0 LO4 Produce technical and user documentation. Assignment Brief and Guidance You have been employed as a Database Developer at a large IT consultancy company. BKC, a local double-glazing company, has approached your company as they are rapidly expanding. New housing developments, as a result of the government’s program of regenerating the old disused factory complexes outside the city of Sheffield, have caused a huge increase in the demand for their products and services from building contractors. BKC has, to date, managed their business by using a computerized system which was developed by a college student five years ago. The system is now too slow, and no system documentation was produced when it was implemented so changes to the system cannot be made easily. The CEO of BKC feels that, as their business requirements have changed, to grow and manage their business successfully they need to invest in new technology and a new system. They currently have sales agents who follow up sales leads which are mainly generated from their marketing material and calls taken by staff in the company office. Sales are also generated by the agents who visit building contractors. Each visit from lead results in a quote and some of these quote’s result in an actual sale, either to supply only or to supply and install. BKC supplies a huge range of windows and doors. They buy most of their products in bulk from a few large manufacturers and store the products in their warehouse. They also make some bespoke windows and doors in their workshop in the warehouse. Your company has accepted the contract to develop a database system for BKC and to provide the necessary technology to run the system. Your brief is to develop the database system element of the contract from BKC. You have been asked by your manager to investigate the system requirements, design, create and implement the system. One of the requirements of the contract is that user and technical documentation be made available to BKC. Part 1 (LO1) Before you start the development process, your manager has asked you to produce a detailed report for the CEO of BKC. Using appropriate tools and techniques, you will produce a comprehensive design for a fully functional relational database system which will include at least four example tables, interface, and output designs, data validations, and cover data normalization. They would also like you to evaluate your design with the client’s requirements. Part 2 (LO2 & LO3) Once the designs have been accepted by your manager, you have been asked to develop, implement, and test the database and then produce a presentation or demonstration for representatives of BKC. The client wants to be shown evidence of input and output interfaces, as well as evidence for results and data validation. Utilizing a query language, evidence, and assessing the quality of the data across multiple tables. Consideration should also be given to security and ongoing 0 0 maintenance issues. Evidence and assess your testing against the client’s requirements, including how the choice of test data impacted the effectiveness of the testing and suggest improvements to the system. Part 3 (LO4) Finally, BKC has asked that technical and user documentation be also produced for distribution to a staff of varying computer literacy to help them navigate the database’s interfaces. To aid future maintenance and continued system effectiveness, the flow of data through the system should be shown as well as suggested improvements to the database system. Pass Merit LO1. Differentiate between the role of a leader and the function of a manager. M1. Produce a P1. Design a relational comprehensive design for a database system using fully functional system which appropriate design tools and techniques, containing at least includes interface and output designs, data validations and four interrelated tables, with data normalisation. clear statements of user and system requirements. LO2. Develop a fully functional relational database system, based on an existing system design P2 Develop the database system with evidence of user interface, output, and data validations, and querying across multiple tables. M2 Implement a fully functional database system which includes system security and database maintenance. M3 Assess whether meaningful data has been extracted through the use of query tools to produce appropriate management information. LO3 Test the system against user and system requirements P4 Test the system M4 Assess the effectiveness against user and system of requirements. the testing, including an explanation of the choice of test data used. LO4 Produce technical and user documentation P3 Implement a query language into the relational database system. P5 Produce technical and M5 Produce technical and 0 0 Distinction D1. Evaluate the effectiveness of the design in relation to user and system requirements. LO2 & 3 D2 Evaluate the effectiveness of the database solution in relation to user and system requirements, and suggest improvements D3 Evaluate the database in terms of improvements needed to ensure the continued effectiveness of the system. user documentation. user documentation for a fully functional system, including diagrams showing movement of data through the system, and flowcharts describing how the system works. Table of contents 0 0 LO1.Use an appropriate design tool to design a relational database system for a critical problem P1.Design a relational database system using appropriate design tools and techniques, containing at least four interrelated tables, with clear statements of user requirements and systems M1.Creates a comprehensive design for a fully functional system including interface and output design, data validation, and data normalization. D1.Evaluates the effectiveness of the design in relation to user and system requirements LO2.Develop a fully functional relational database system, building on the existing system design P2.Develop a database system with proof of user interfaces, outputs, and data validation and queries across multiple tables. P3.Implement a query language into a relational database system M2.Implement a fully functional database system including system security and database maintenance. M3.Assess whether meaningful data has been extracted through the use of query tools to generate appropriate management information LO3.System testing according to user and system requirements P4. Check User and System Requirements M4. Evaluation of the effectiveness of the trial, including an explanation of the selection of test data used D2.Performance of the database solution regarding user and system requirements, and recommending improvements D3. Improvements may be required to ensure the continued effectiveness of the database system LO4.Production of technical and user documentation P5.Producing technical and user documentation M5.Create technical and user documentation for a fully functional system, including diagrams that show the movement of data through the system and flowcharts that describe how the system works INTRODUCE 0 0 You have been employed as a Database Developer at a large IT consulting company. BKC, a local double-glazing company, has approximated your company as they are rapidly expanding. New housing developments, as a result of the government's program of regenerating the old disused factory complexes outside the city of Sheffield, have caused a huge increase in the demand for their products and services from building contractors. BKC has, to date, managed their business by using a computerized system which was developed by a college student five years ago. The system is now too slow, and no system documentation was produced when it was implemented so changes to the system cannot be made easily. The CEO of BKC feels that, as their business requirements have changed, to grow and manage their business successfully they need to invest in new technology and a new system. They currently have sales agents who follow up sales leads which are mainly generated from their marketing material and calls taken by staff in the company office. Sales are also generated by the agents who visit building contractors. Each visit from lead results in a quote and some of these quote’s result in an actual sale, either to supply only or to supply and install. BKC supplies a huge range of windows and doors. They buy most of their products in bulk from a few large manufacturers and store the products in their warehouse. They also make some bespoke windows and doors in their workshop in the warehouse. Your company has accepted the contract to develop a database system for BKC and to provide the necessary technology to run the system. Your brief is to develop the database system element of the contract from BKC. You have been asked by your manager to investigate the system requirements, design, create and implement the system. One of the requirements of the contract is that user and technical documentation be made available to BKC. LO1.Use an appropriate design tool to design a relational database system for a critical problem 0 0 P1.Design a relational database system using appropriate design tools and techniques, containing at least four interrelated tables, with clear statements of user requirements and systems 1. Problem statement To date, BKC has operated its company using a computer system created by a university student 5 years ago. The system is currently too slow, and since no system documentation was created when it was developed, it was difficult to make improvements. BKC executives believe that, as their business needs have evolved, they must adapt to successfully expand and operate the company. 2. Describe the binding of the objects of interest A. Admin panel Field Name Admin_id Data type int Field Size 11 username password name Varchar Varchar Varchar 32 32 128 Description of attribute Primary key and let this field increment ítelf Use name pasword name Field Name Data Type Field Size Description of attribute Employee_id Varchar 10 Id employee Name Varchar 50 name email Varchar 50 Email use to login phone Varchar 15 Phone of employee password Varchar 40 Pasword use to login created int 11 Member registration time address Varchar 128 address Data Type Field Size Description of attribute B. Table employee C. Customer Field Name 0 0 Customer_id Varchar 10 Id customer name Varchar 50 Name of customer address Varchar 50 Address of customer phone Varchar 15 Phone of customer D. Transaction Files name Data type Files size Description of attribute Transaction_id Product_id Employee_id Date_invoice Date_receipt amount payment Varchar Varchar Varchar Date Date demical Varchar 10 10 10 id transaction Id product Id employee Invoice date Date of receipt of goods total payment The name of the payment gateway that the customer chooses to pay 15,2 32 E. Product Field Name Data Type Field Size Description of attribute Product_id Varchar 10 Id product name Varchar 10 Name product image Text price decimal Image product 9,2 Price product E. Order 0 0 Files name Data type Field size Description of attribute Order_id Varchar 10 id order Transection_id Varchar 10 id transection Product_id qty amount status Varchar int demical tinyint 10 11 15,2 4 Id product The number of products Order amount status Data type Varchar Varchar Varchar decimal int Field size 10 10 10 9,2 10 Description of attribute Id of order detail Id of product Id of order price quantity F. Order detail Field name Order_detail_id Product_id Order_id price quantity M1. Create a comprehensive design for a fully functional system including interface and output design, data validation, and data normalization. A category can have products but a product can only belong to one category => the relationship between Category and Product is One to Many An account belongs to an employee and 1 employee has only an account => the relationship between account and employee is one to one One employee can import many products and one product can be imported by many employee => the relationship between Employee and Product is Many to Many A customer can have many orders, but an order can only belong to one customer => the relationship between Customer and Order is One to Many A product can have many orders and an order can also have many products => the relationship between Product and Order is Many to Many ERD is a diagram, showing the entities in the database, and the relationship between them. Some tools features to draw ERD: DeZign for Databases: 0 0 Drag-and-drop user interface Entity Relationship Diagramming Multiple display modes Industry-standard design notations Multiple display modes Pan and zoom window ER-Modeling Forward engineering Reverse engineering Gleek.io Keyboard-based user interface Rapid Diagramming Version Control Live Collaboration Diagram export Design templates Customization dbdiagram.io Generates SQL statements Exports to images and PDFs One-click sharing Integrates with SQL databases ERDPlus 0 0 User-friendly interface, easy to use Full EDR vẽ drawing features Through the above features, I use ERDPlus to draw Diagram to Relation Diagram. D1. evaluates the effectiveness of the design in relation to user and system requirementsEntityrelational model Is a high-level conceptual data model that systematically analyzes data requirements to create a best-in-class database. Entity-relationship model represents entities and the relationships between them. Deploying this model is an effective method of working before deploying on the DBMS. The entity-relational model was proposed by Peter Chen in 1971 to create a unified convention that could be used for relational and network databases. Besides, he also uses the model to approach the conceptual modeling. Entity Relationship Diagram 0 0 Entity-relationship diagrams, abbreviated as ERDs, represent the relationships of a collection of entities stored in a database. Diagrams assist in explaining the logical structure of the database. The ERD includes many specialized symbols, and its meanings make this pattern unique. Why use entity-relationship diagrams? Helps define terms related to entity-relationship modeling. Give a preview of how all the tables in the DBMS will be connected, what fields or attributes will be present on each table. Describe entities, attributes, and relationships. Entity-relationship diagrams can be converted to relational tables, thus allowing for rapid database construction. Entity-relationship diagrams are used by database designers as a blueprint for implementing data in applications and software. ERD allows to convey the logical structure of the database to the user. - Methods for Effective ERD Implementation Remove any redundant entities or relationships. Make sure that all entities and relationships are properly labeled. Make sure that the entity-relationship diagram supports all the data that needs to be stored. Ensure that each entity appears only once in the ER diagram. Name every relationship, entity, and attribute shown on the diagram. Never associate relationships with each other. Color can be used to highlight important parts of the diagram. LO2. Develop a fully functional relational database system, building on the existing system design P2 Develop a database system with proof of user interfaces, outputs, and data validation and queries across multiple tables. 1. Database Design Database is a system of structured information, stored on storage devices to satisfy the requirements of simultaneous information extraction of many users or many applications running at the same time. with different purposes. DBMS (Database Management System) is software to help manage databases. DBMS provides users with functions such as creating, retrieving, updating and managing data on a database. 0 0 In addition to data management functions, database management systems also provide users with functions to control read/write access, specify report generation, and analyze usage. With most DBMSs today, we will often need to use SQL (structured query language) to interact with the database. Popular DBMS Software Here is a list of some popular DBMS systems including open source and privately owned software: • MySQL: Free and open source. • MariaDB: Free, open source. • PostgreSQL: Free, open source. • SQLite: Free, open source. • Oracle Database: Privately owned by Oracle, for a fee. • SQL Server: Privately owned by Microsoft, for a fee. • Microsoft Access: Privately owned by Microsoft, for a fee. Flexible and easy to use You can modify the source code to meet your needs at no extra cost. The installation process is also very simple and usually takes no more than 30 minutes. High performance Many server clusters use MySQL. No matter you store large data of e-commerce sites or ITheavy businesses, MySQL can handle it with smooth, high speed. Industry standards The data and technology industry has used MySQL for many years so it is a fundamental skill for a professional programmer. MySQL users can also deploy projects quickly and hire data experts for a fee if they need to. Safety Data security is always the most important issue when choosing RDBMS software. With its decentralized access and account management system, MySQL sets very high security standards. Credential encryption and host authentication are both available. 0 0 From the above priorities, we will choose the site using MY SQL to deploy the project's database Create the required tables Create admin table CREATE TABLE `admin` ( `admin_id ` tinyint(4) NOT NULL AUTO_INCREMENT, `usename` varchar(32) NOT NULL, `password` varchar(32) NOT NULL, `name` varchar(50) NOT NULL, PRIMARY KEY (`admin_id`) ) ENGINE=InnoDB ; Create table employee CREATE TABLE `employee` ( `employee_id` varchar(10) not null, `name` varchar(32) NOT NULL, `usename` varchar(50) not null , `password` varchar(32) NOT NULL, `phone` varchar(15) NOT NULL, `address` varchar(50) not null, PRIMARY KEY (`employee_id`) ) ENGINE=InnoDB ; Create table customer CREATE TABLE `customer` ( `customer_id` varchar(10) not null, `name` varchar(32) NOT NULL, `phone` varchar(15) NOT NULL, `address` varchar(50) not null,.+ PRIMARY KEY (`customer_id`) ) ENGINE=InnoDB ; 0 0 Create table product CREATE TABLE `product` ( `product_id` varchar(10) not null, `name` varchar(32) NOT NULL, `price` decimal(9,2) not null , `image` text default null , PRIMARY KEY (`product_id`) ) ENGINE=InnoDB ; Create table transanction CREATE TABLE `transanction` ( `transaction_id` varchar(10) not null, `employee_id` varchar(32) NOT NULL, `product_id` varchar(10) not null , `date_invoice` date NOT NULL, `date_receipt` date NOT NULL, `amount` decimal(15,2) not null , `payment` varchar(32), PRIMARY KEY (`transaction_id`) ) ENGINE=InnoDB ; Create table order CREATE TABLE `order` ( `order_id` varchar(10) not null, `customer_id` varchar(32) NOT NULL, `address` varchar(50) not null , `phone` varchar(10) NOT NULL, `note` varchar(50) default NULL, 0 0 PRIMARY KEY (`order_id`) ) ENGINE=InnoDB ; Create table order_detail create table `order_detail`( `order_detail_id` varchar(10) not null , `product_id` varchar(10) not null, `order_id` varchar(10) not null, `price` decimal(9,2) not null, `quantity` int not null, primary key (order_detail_id) ) engine=innoDB; 2.Database Diagram: P3 Implement a query language into a relational database systemSelect Insert normally: 0 0 Table customer Table employee 0 0 Table order Table order_detail 0 0 Select with employee and transanction: Run project a. Insert 0 0 Add data to admin table 0 0 Add data to employee table Update Edit data in product table 0 0 Before editing After editing Delete delete data in employee table 0 0 before deleting after deleting 0 0 M2 Implement a fully functional database system including system security and database maintenance. a. Trigger The trigger (from the Dutch trekken, meaning pull) is a lever that, when pulled with a finger, releases the hammer on the gun. In a database, a trigger is a set of Structured Query Language (SQL) statements that automatically "trigger" an action when a specific operation, such as a change in data in the database, occurs. table, happens. What is the function of the trigger? Generating a response to an event is performed using a trigger. A trigger is a statement that you are interested in a certain event or set of events. Binding a function to a trigger allows you to capture and act on events. MySQL Triggers are a database object in MySQL associated with a table. When an INSERT, UPDATE, DELETE event occurs in the database table, the Trigger will be fired and execute a task you want. Triggers can be fired before and after the event is fired. Create another table to save the change history 0 0 Create trigger for each event add, remove, edit, dele Try with insert statement Result b. Create a user with access to only one database with a Graphical User Interface (GUI) Step 1 At your browser type ” http://localhost/phpMyAdmin ” Step 2 Navigate to the Users Tab and Click ” Add User ” 0 0 Ad d New User at MySql Step 3 Populate New User Credentials at the (Login Information Only) (1) UserName (2) Password (3) Server ( this example is localhost ) Note : Do not global privilege , and check all , this will grant the User Access to all your Database in the Systems 0 0 populate new user username and password Step 4 Check whether your New User is being created In this Example New User Name : david Password :david 0 0 Check New User created Step 5 At the User List . Click the New User that you have just Created In this Example is David then (1) at ” Privilege to the following database” select the Database that you want your new User to access. In this Example is mydata Data Base (2) Then Click ” go ” 0 0 Select Which Database the New User can Access Step 6 Grant the new User , privilege , fields that he or she can access to your specific data base In this Case I grant all Privilege to David on mydata Database Grant the User Privellege what he can do with the Database 0 0 Step 7 After you grant access and privileges of the specific Database to your new User . Double check whether the Setting is being Configure (1) go to Database (2) Select your Specific Database, in this case for me is mydata Database (3) click Privelleges (4) Check whether your new User have access to this Data base Check New User Access Right to the Specific DatabaseM3. Assess whether meaningful data has been extracted through the use of query tools to generate appropriate management information display tables in a database 0 0 display tables when editing information display errors during data extraction can display requests that have been made requests that have been passed after displaying the tables The process runs very quickly and needs some more accuracy requirements in the process of importing and exporting data and connecting between tables. LO3 System testing according to user and system requirements P4 Check User and System Requirements Test What is being tested TC1 Add new product Test data How Enter data from Set 1 data capture sheet into insert 0 0 Expected Result The product was stored into the Actual results Action taken Ok None database TC2 Show list of products Select all products in the Products table with query Select Set 2 Show all values Products Ok None TC3 Update ID_mf Update the ID_mf = “MF001”with id_prd is “PRD004” Set 3 Ok Update ID_mf “MF002” to “MF001” None TC4 Delete ID_prd = “PRD008” Delete the product with id “PRD008” Set 4 Ok Delete Product with id “PRD008” None TC5 Show ID_prd, Quantity, ID_wh of Product having Quantity >=250 Use the query Set 5 Select to show ID_prd, Quantity, ID_wh of Product having Quantity >=250 The result will show ID_prd, Quantity, ID_wh wh of Product having Quantity >=250 Ok None TC6 add a new product Enter data from Set 6 data capture to the ProductManagemen sheet into insert t table having Quantity of product <0 Data cannot store because statement Ok None Ok None conflicted with the CHECK constraint TC7 Check foreign key Enter the ID_prd that is constraint of ProductManagemen not in the 0 Set 7 Data cannot store because 0 t table to Products table Products table into the ProductManage ment table conflicted with the FOREIGN KEY constraint "FK_id_prd" M4 Evaluation of the effectiveness of the trial, including an explanation of the selection of test data used requirements can be expressed Fast operation and high accuracy D2 performance of the database solution regarding user and system requirements, and recommending improvements Assign access rights Decentralization is the delegation of authority for a member to do and not to do in the software. Deeply decentralized software will allow managers to strike a balance between making it easy for employees to collaborate, while also protecting company data. For example, if you're working on a project with highly sensitive data, you need the project team to have enough permissions to collaborate, but you also want to maintain moderate information access. enough for each member. The decentralization feature in Base's software is intensively researched and developed, with the desire to help administrators achieve this balance. User identification; MySQL uses a different authentication protocol for server access and identity than SQL Server and Oracle. The identity of the MySQL user is checked using three pieces of information: Hostname; MySQL Username and MySQL Access Password. In order to access the database, the identifier must match the certificates stored in the database, the login name is completely separate from the operating system login account, and there is also no relationship between the password. MySQL password with the operating system password. The hostname may show up as an IP address and may not need to be provided if it is a server running MySQL. There are three components stored in the users table: host, user, and password. Connections are allowed only when those three values match. Information encryption and data compression; 0 0 Information encryption is the transformation of data into another form of data with a different meaning than the data before the original transformation, for the purpose of allowing the data to be readable by some people. Initially, through the decoding of the data after the conversion. In other words, encryption is turning the original data A into data B, and reading data A will be through the decryption of data B about A. Data compression is a change in data structure, the purpose is to reduce storage capacity, contribute to increase data security. When there is compressed data, it is necessary to understand the compression rules to be able to decompress and restore the original data. Policy and consciousness; Security can be accomplished by both hardware and software engineering solutions. However, the security still depends on the guidelines and policies of the information owner and the user's consciousness The person analyzing, designing and creating the database must have a good solution of the right hardware and software Users must be aware of information protection recordkeeping. In addition to the above solutions, people also organize to save system minutes The system log usually says - number of visits to the system - information about the number of last login attempts System records significantly support system recovery in the event of a technical problem and provide information that allows users to assess the level of user interest in the system in general and each component of the system. in particular there are many elements of the protection system that can change during database mining In order to improve security efficiency, the system's parameters must be changed regularly It should be noted that both hardware and software solutions do not guarantee absolute safety of the system 0 0 LO4. Production of technical and user documentation P5 .Producing technical and user documentation Delete Database in SQL Server Right-click on the Database to be deleted in the Databases list on the left > Delete The Delete Object window displays. Please check the box Close existing connections > OK to be sure to delete it. 0 0 0 0 In the query, write a statement with the following syntax. Highlight > Excute (Shortcut F5) Some notes in SQL Database already exists During the process of creating Database using UI, if you encounter the following error, it means that the Database name you want to initialize is the same as the Database name already available in SQL Server. 0 0 Did not find the newly created database or still see the deleted database in the list In some cases, you may not see the newly created Database, or still see the name of the deleted Database in the list of Databases on the left after successfully executing the command. You right click on Databases > Refresh to update the Database list Execute command in Query During the execution of the command (Excute) in the Query: When you highlight a command line, only that command line is executed. If you do not highlight the command line to be executed but press Excute (F5), all commands in that query will be executed. What is easy to cause data duplication error, or cannot execute the command, the command is faulty, ... Save the query containing the command The query is saved as a regular file. Select Save or the keyboard shortcut Ctrl + WILL 0 0 0 0 Select the location to save the Query in the red frame > enter the Query name in File name or save it under the default name > Save M5. Create technical and user documentation for a fully functional system, including diagrams that show the movement of data through the system and flowcharts that describe how the system works https://www.gleek.io/blog/best-erd-tools.html https://vietnix.vn/he-quan-tri-co-so-du-lieu/ https://viblo.asia/p/tong-hop-ve-chuan-hoa-co-so-du-lieu-ORNZqP33K0n 0 0