Download presentation
Presentation is loading. Please wait.
Published byJulius Rodgers Modified over 8 years ago
1
Game Store Database. To start off, the purpose of this particular database design is to regulate the basic inner workings of a game store. This design Includes the purchasing of products in the store as well as orders that will be shipped. The database also includes important information about the products being sold as well as the departments they belong to and the employees that work in those respective departments.
2
The Problem In the past all purchases were done in the store only and the business kept physical records of purchases instead of digital records. During the upgrades the game store decided that they wanted to not only start using digital records but they also wanted to start mailing products to customers who placed orders. Design the database so that it efficiently keeps track of all customers in a single table. Create separate tables for online purchases as well as in store purchases Link all products to the customers who purchased/ordered them in their respective tables. The Solution
3
ER Diagram
4
Relational Schema
5
Data Dictionary AttributeTableNull?Unique?PKEY?FKEY?Domain Product_IDGamesNoYesNoYesNumber : 4 PlatformGamesNo String : 20 Release_DateGamesNo String : 20 Number_Of_PlayersGamesNo Number : 4 Game_TypeGamesYesNo String : 20 Product_IDAccessoriesNoYesNoYesNumber : 4 DescriptionAccessoriesYesNo String : 100 Platform_designed_forAccessoriesNo String : 20 Product_IDConsolesNoYesNoYesNumber : 4 SizeConsolesNo String : 20 SpecsConsolesNo String : 100 DetailsConsolesYesNo String : 100 Product_IDProductsNoYes NoNumber : 4 Department_IDProductsNoYesNoYesNumber : 4 Product_NameProductsNo String : 20 Product_DescriptionProductsYesNo String : 100 Product_PriceProductsNo String : 15 Quantity_AvailableProductsNo Number : 5 Department_IDDepartmentsNoYes NoNumber : 4 Department_NameDepartmentsNo String : 20 Number_Of_EmployeesDepartmentsNo Number : 4
6
Data Dictionary Cont. AttributeTableNull?Unique?PKEY?FKEY?Domain Employee_IDEmployeesNoYes NoNumber : 4 Department_IDEmployeesNoYesNoYesNumber : 4 First_NameEmployeesNo String : 30 Last_NameEmployeesNo String : 30 GenderEmployeesYesNo String : 10 Hourly_RateEmployeesYesNo String : 15 Purchase_IDCustomer_PurchasesNoYes NoNumber : 4 Customer_IDCustomer_PurchasesNoYesNoYesNumber : 4 Product_IDCustomer_PurchasesNoYesNoYesNumber : 4 Payment_MethodCustomer_PurchasesNo String : 10 QuantityCustomer_PurchasesNo Number : 4 Order_IDOrdersNoYes NoNumber : 4 Customer_IDOrdersNoYesNoYesNumber : 4 Product_IDOrdersNoYesNoYesNumber : 4 Date_Of_OrderOrdersYesNo String : 20 QuantityOrdersYesNo Number : 4 Customer_IDCustomersNoYes NoNumber : 4 Customer_FirstCustomersNo String : 30 Customer_LastCustomersNo String : 30 Customer_Phone_NumberCustomersYesNo String : 20 AddressCustomersNo String : 75
7
SQL statements for creating tables and inserting records into the tables SQL statements...
8
Tables Products Games Accessories Consoles
9
Tables Cont. Orders Customers Customer_Purchases
10
Tables Cont. Departments Employees
11
Queries A query designed to get the total price of a specific orders select c.Customer_First as first, c.Customer_Last as last, p.product_Price*o.Quantity as Order_Price from customers c, products p, orders o where c.customer_ID=o.Customer_ID AND o.Product_ID=p.Product_ID order by c.customer_first; A query designed to get the total price of a specific Purchase select distinct c.Customer_First as first, c.Customer_Last as last, p.product_Price*cp.Quantity as Purchase_Price from customers c, products p, customer_Purchases cp where c.customer_ID=cp.Customer_ID AND cp.Product_ID=p.Product_ID order by c.customer_first;
12
Conclusion The database was functional and works quite well with Oracle. Overall not many flaws in the data. The solution to the problem was also a success and the relational system is quite easy to work with and very functional.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.