database management systems project report
TRANSCRIPT
Project Report
Ecig & Vape Depot Point Of Sale System
Sheena NguyenAlejandro Martinez
Courtney Wingo
Discovery Process:
Sheena Nguyen has been an employee at Ecig & Vape Depot for several years and is familiar with the system. We conducted an interview with the owner in order to gain an in depth understanding in what is essential for the system to work efficiently and in what areas it can improve on. The owner, Thomas Chae, agreed to meet with us in-store to demonstrate a basic transaction on the system and agrees to answer any further questions we may have via telephone or e-mail. In the first discussion we had with Mr. Chae, he gave us an inventory form that he uses to double check his stock in order to make sure certain items match what is shown in the system. One flaw he briefly mentioned is that he has three stores, but the databases are independent of each other.
Meetings:
In-Store Meeting 2-19-15: We were demonstrated how a basic transaction takes place, how payment is processed, inventory is of products is noted, and how each transaction had a unique identification number. We asked for more details in what the system can help him do in regards to his three departments. His response was simply to be able to look up inventory from all three stores.
Team Meeting 2-22-15: We scheduled a meeting in order to outline the scope of the project, what entities will be need, what the current ERD is, and what needs to be changed within the current organization.
In-Store Meeting 02-27-15: Sheena met with the owner to review the information that was concluded in the previous meeting and if there were any objections or comments. All entities were improved and we created a conceptual
Entity Definition:
Store: Represents each of the three stores that will be storing inventory, which include Duluth, Buford, and Mall of Georgia
Employee: Represents each individual that is employed within the company.
Customer: Represents a person that is purchasing goods from the company.
Supplier: Represents the company that is providing the goods sold to the store.
Product: Represents goods that are sold at any of the three locations.
Category: Represents data pertaining to product category
Transaction: Represents an individual exchange encounter between the customer and the employee, where the customer purchases goods.
Transaction Details: Represents data pertaining to customer services
Product_Supplier: An associative entity that is used to implement a many-to-many relationship between the Product and Supplier entities.
Justification for ERD (including Attributes):
Based on the interview we conducted with Thomas Chae and the forms he provided, we were able to conclude that these are the entities we will need to build our database:
● Employee – This tells us which employee was involved in processing the transaction and is essential for transaction.
● Transaction – This entity is needed in our database in order to keep track of the various transactions. It contains data pertaining to employee-customer transactions; also, entity is
needed in our database in order to keep track of data pertaining to customer purchases.
● Store – Company operates in dozens of locations internationally. It is very important to be able to keep track of each location’s information.
● Employee and Transaction has a one-to-many relationship. An employee can perform many transactions and a transaction can only be performed by one employee. The many
sides of the cardinalities would go to the transaction table.
● Product and Transaction have a one-to-many relationship with one another. This is because one product can be included in one transaction, but transactions can include
many products. You can only purchase one product per transaction. If purchasing multiple units of a product, the item will appear each time it is scanned in the transaction
process.
● Customer and Transaction have a one-to-many relationship because one customer can have many transactions in multiple stores, but the transaction can only be assigned to one
customer.
● Product and Supplier have a many-to-many relationship because the stores can obtain multiple products from multiple suppliers registered with the company. Also, many
suppliers can sell many products to the company. An associative entity, Product_Supplier, is used to implement a many-to-many relationship between the
Product and Supplier entities.
● Product and Category have a one-to-many relationship because a product can only be placed into one category, while a category can apply to many products (goods) sold
within the company.
● Transaction and Store have a one-to-many relationship because many transactions can be made at one store. However, each single transaction will have taken place at only one
store.
Justification for Primary Keys and Foreign Keys:
● Employee Table: The Employee_ID was chosen as the primary key because it serves as a unique identifier for this entity.
● Customer Table: The Customer_ID was chosen as the primary key because it serves as a unique identifier for this entity.
● Transaction Table: The Transaction_ID was chosen as the primary key because it serves as a unique identifier for this entity. Customer_ID was chosen as the first foreign key in order to relate the transaction to the customer. Employee_ID was chosen as the second foreign key in order to link the transaction back to the employee involved. Product_ID
was chosen as the third foreign key in order to link the product table with the transaction.● Store Table: The Store_ID was chosen as the primary key because it serves as a unique
identifier for this entity. Since there are three different locations, they need to be distinguished using this unique key. The purpose of this database is to connect the three stores’ information to one another. Transaction_ID is an appropriate foreign key for this
table because of the correlation between the transaction and the store the transaction occurs in.
● Product Table: The Product_ID was chosen as the primary key because it serves as a unique identifier for this entity. Cateogry_ID is the foreign key for this table to identify the category in which the product can be placed. This allows for further grouping of this
information. ● Supplier Table: The Supplier_ID was chosen as the primary key because it serves as a
unique identifier for this entity. Since the company can have many suppliers to give them products, their information needs to be kept separate from each other using a unique key.
● Category Table: The Category_ID was chosen as the primary key because it serves as a unique identifier for this entity. Since there are multiple categories, they all need to be
distinguished using this unique key. ● Product_Supplier Table: When writing an associate table, a composite key is required.
In this case, that primary/composite key is Product_Supplier_ID. The other foreign keys, Supplier_ID and Product_ID, help associate this table with to the Supplier and Product
tables respectively.
APPENDIX A
Interview notes with Owner
Thomas Chae
How much data does the database store?
Chae: I have about 250 different products in each store from 60 vendors, approximately.
Who are the users and what is used most in this system other than a transaction?
Chae: The employees and I normally use the search function on a daily basis to make sure that we have a product in stock. If we do not have something then we call another location to check their stock.
How is data entered into the system?
We receive shipments throughout the month completed by manual order. The items are entered manually.
Data Dictionary
Table Name: Customer
Description: Contains customer data (and unique customer identifiers)
Column (Field) Name PK?
FK?
Description
Customer_ID X Unique numeric identifier for each Customer
First_Name Customer first name
Last_Name Customer last name
Phone Customer phone number
Address Customer address
Email Customer email
Table Name: Employee
Description: Contains Employee data (and unique Employee identifiers)
Column (Field) Name PK?
FK?
Description
Employee_ID X Unique numeric identifier for each health care Provider
First_Name Employee first name
Last_Name Employee last name
Hire_Date Date hired the employee was hired
Birth_Date Employee date of birth
Phone Employee phone number
Address Employee address
Table Name: Transaction
Description: Contains data pertaining to employee-customer transactions (encounters)
Column (Field) Name PK?
FK?
Description
Transaction_ID X Unique numeric identifier for each transaction
Product_ID X Unique numeric identifier for each product
Customer_ID X Unique numeric identifier for each customer
Employee_ID X Unique numeric identifier for each employee
Transaction_Date Date of transaction
Discount Any applicable discounts applied
Table Name: Product
Description: Contains data pertaining to Customer Purchases
Column (Field) Name PK?
FK?
Description
Product_ID X Unique numeric identifier for each Product
Product_Name Name of product
Category_ID X Unique numeric identifier for each category
Quantity_Per_Unit Quantity of each unit
Unit_Price Price of each unit
Units_In_Stock Number of units in stock
Units_On_Order Units currently on order
Table Name: Supplier
Description: Contains data pertaining to Customer Purchases
Column (Field) Name PK?
FK?
Description
Supplier_ID X Unique numeric identifier each Supplier
Company_Name Name of company
Contact_Name Name of contact
Contact_Title Title of the contact in the company
Phone C company phone number
Address Company address
Fax Company fax number
Website Company website
Email Company email
Table Name: Category
Description: Contains data pertaining to Product Category
Column (Field) Name PK?
FK?
Description
Category_ID X Unique numeric identifier each Category
Category_Name Name of category
Description Description of category
Table Name: Store
Description: Represents each of the three locations that will be storing inventory
Column (Field Name) PK?
FK?
Description
Store_ID X Unique numeric identifier for one of the three stores
Address Mailing address for one of the three stores
Phone Contact phone number for each of the three stores
Transaction_ID X Unique numeric identifier for each transaction
Table Name: Product_Supplier
Description: An associative table that connects the product and supplier information
Column (Field Name)
PK? FK? Description
Product_Supplier_ID X Unique numeric identifier for a combination of product and supplier
Product_ID X Unique numeric identifier for each product
Supplier_ID X Unique numeric identifier each supplier
SQL Queries:
CREATE TABLE Employee(Employee_ID INT NOT NULL UNIQUE,First_Name VARCHAR() NOT NULL,Last_Name VARCHAR() NOT NULL,Hire_Date DATE NOT NULL,Birth_Date DATE NOT NULL,Phone CHAR(_,_) NOT NULL,Address VARCHAR() NOT NULL,PRIMARY KEY (Employee_ID),);
CREATE TABLE Store(Store_ID INT NOT NULL UNIQUE,Phone CHAR(_,_) NOT NULL,Address VARCHAR() NOT NULL,PRIMARY KEY (Store_ID));
CREATE TABLE Transaction(Transaction_ID INT NOT NULL UNIQUE,Transaction_Date DATE NOT NULL,Discount NUMBER(_,_) NOT NULL,Employee_ID INT NOT NULL,Store_ID INT NOT NULL,Customer_ID INT NOT NULL,Product_ID INT NOT NULL,PRIMARY KEY (Transaction_ID),FOREIGN KEY (Employee_ID) REFERENCES Employee (Employee_ID),FOREIGN KEY (Store_ID) REFERENCES Store (Store_ID),FOREIGN KEY (Customer_ID) REFERENCES Customer (Customer_ID),FOREIGN KEY (Product_ID) REFERENCES Product (Product_ID));
CREATE TABLE Customer(Customer_ID INT NOT NULL UNIQUE,First_Name CHAR() NOT NULL,Last_Name CHAR() NOT NULL,Phone CHAR(_,_) NOT NULL,Address VARCHAR() NOT NULL,Email VARCHAR() NOT NULL,PRIMARY KEY (Customer_ID));
CREATE TABLE Product(Product_ID INT NOT NULL UNIQUE,Product_Name CHAR() NOT NULL,Quantity_Per_Unit INT NOT NULL,Unit_Price NUMBER(_,_) NOT NULL,Units_In_Stock INT NOT NULL,Units_On_Order INT NOT NULL,Product_Supplier_ID INT NOT NULL,Category_ID INT NOT NULL,PRIMARY KEY (Product_ID),FOREIGN KEY (Category_ID) REFERENCES Category (Category_ID));
CREATE TABLE Category
(Category_ID INT NOT NULL UNIQUE,Category_Name CHAR() NOT NULL,Description VARCHAR() NOT NULL,PRIMARY KEY (Category_ID));
CREATE TABLE Product_Supplier(Product_Supplier_ID INT NOT NULL UNIQUE,Product_ID INT NOT NULL,Supplier_ID INT NOT NULL,PRIMARY KEY (Product_Supplier_ID),FOREIGN KEY (Product_ID) REFERENCES Product (Product_ID),FOREIGN KEY (Supplier_ID) REFERENCES Supplier (Supplier_ID) PRIMARY KEY**);
CREATE TABLE Supplier(Supplier_ID INT NOT NULL UNIQUE,Company_Name CHAR() NOT NULL,Contact_Name CHAR() NOT NULL,Contact_Title CHAR() NOT NULL,Phone CHAR(_,_) NOT NULL,Address VARCHAR() NOT NULL,Fax CHAR(_,_) NOT NULL,
Website VARCHAR() NOT NULL,Email VARCHAR() NOT NULL,PRIMARY KEY (Supplier_ID));
¤ SELECT [field],[field],[field]… ¤ FROM [table] JOIN [table] ¤ ON [relationship] [JOIN table ¤ ON relationship]… ¤ WHERE [filter]
open mysqlclick models+add diagram