Order Management Database
This project is to manage customers and the orders they place online for a local company. The company’s employees are responsible to manage the order. The purpose of the project is to take orders online by the customers and maintain their information in the system. The system will also maintain the details of the current employees. Order information is maintained in the system that can be shipped to the customers. This allows the company to expand beyond just a store front and to keep a better track of customers’ information and what they order.
The system will maintain the information about the customers, orders, order details, items, and employee information. Employees will enter the information of Customers in the system or the customers themselves can do it online. The employee can then enter the information of the orders placed by these customers. The system will also keep a track of orders that are shipped and their details. The project will consist of 5 tables.
See compressed file.
For this week I had to establish a connection to the database from my programming language (HTML). For me to do so I pretty much had to start from scratch by renaming the database to login and adding an additional table call users. This table is what I use to store the data that was and will be enter by any user. I also use XAMPP, PHP with MySQL to help connect to the database as well. Below is a screenshot of the users table with a few data already stored in using the login system I created. Attach is also the HTML code to get to the login system.
For this week I had to write programs that will allow me to add a record, change a record, and delete a record for each of the tables in my database. I did that by creating an insert, update and delete stored procedure for each of the tables in my database.
Below is a screenshot of all the procedures created with the naming convention specifying what each procedure is doing on which table.
Below I’ll post the statement for one of each type of procedures (being that it’s 15). I will only post one for insert, update and delete.
This is the INSERT SP
CREATE PROCEDURE `EmployeeSP_Insert`(IN `employee_id` INT, IN `first_name` VARCHAR(60), IN `last_name` VARCHAR(60), IN `manager_id` INT) NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER INSERT into employees (employee_i,first_name, last_name,manager_id) VALUES (employee_i,first_name, last_name,manager_id);
This is the UPDATE SP
CREATE PROCEDURE `ItemsSP_Update`(INOUT `item_id` INT, INOUT `unit_price` VARCHAR(60)) NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER UPDATE items SET unit_price=unit_price WHERE items.item_id=item_id;
This the DELETE SP
CREATE PROCEDURE `UsersSP_Delete`(INOUT `user_id` INT) NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER DELETE from users WHERE users.user_id=user_id;
Generatedata.com. (2019, March). Retrieved March 24, 2019, from http://www.generatedata.com/
Mmtuts. (2017, June 20). Retrieved April 08, 2019, from https://www.youtube.com/watch?v=xb8aad4MRx8
Technology, H. C. (2017, October 07). Retrieved April 15, 2019, from https://www.youtube.com/watch?v=SPZJt3D5f4k
University, D. (2019, March). Re: Class Discussion [Web log comment]. Retrieved March, 2019.