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:

Coffee Shop ER Diagram

Customer(CustomerID, FirstName, LastName, Street, Town, PostCode, TelephoneNumber, EMailAddress)

CustomerOrder(OrderID, Date, Time, *CustomerID*)

OrderItem(OrderItemID, *OrderID*, *ProductID*, Quantity)

Product(ProductID, Name, Price, *ProductTypeID*)

ProductType(ProductTypeID, Description)

Task 15

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:

Coffee Shop Class Diagram

Task 16

Create the Coffee Shop Application

  • Using the above class diagram to assist you, create an application to manage customer orders in the Coffee Shop.