Completing the coffee shop
Having gained some understanding of foreign keys and referential integrity in the previous section it is now possible to complete the coffee shop database.
The ER diagram and entity descriptions for the database are as follows:
, FirstName, LastName, Street, Town, PostCode, TelephoneNumber, EMailAddress)
, Date, Time, *CustomerID*)
, *OrderID*, *ProductID*, Quantity)
, Name, Price, *ProductTypeID*)
Create the Coffee Shop Database
- Using the ER diagram and Entity Descriptions to assist you, create the Coffee Shop database.
Coffee Shop Application
Now that there is a database for the coffee shop an application needs to be created to add customers and orders to the database. You will need to write this application. You might want to create this application using the object-oriented programming paradigm. One approach would be to create a series of controllers to manage the different functions of the system. The class diagram below shows one possible (incomplete) representation:
Create the Coffee Shop Application
- Using the above class diagram to assist you, create an application to manage customer orders in the Coffee Shop.
- Previous - Referential integrity
- 1. Introduction to databases
- 2. Creating the data model
- 3. Inserting data
- 4. Updating and deleting data
- 5. Searching and sorting data
- 6. Product Management Menu
- 7. Introduction to relational databases
- 8. Creating a data model with relationships
- 9. Referential integrity
- 10. Completing the coffee shop