Self Assessment


1. Consider the two tables below which are part of an e-commerce website database

    a. Specify the primary keys of the Product and Order tables.

    b. Is there a need to link the two tables together and if so, explain how.

    c. There is a missing part of this database, identify it.

    d. What are the integrity rules that will be violated if the following operations are allowed:

            i. Adding row (1109, apple, 7) to the Product table.

            ii. Deleting (1005) from the Product table.

            iii. Adding (NULL, 1005, 987, 4) to the Order table.


Self Assessment



Self Assessment


2. You are required to provide a definition for a car rental database. Your database should have three tables: cars, customers and rentals.

    a. Provide three table schemas for the cars, customers and rentals tables.

    b. Specify the primary key for each table.

    c. Propose a way on how the three tables can be linked using foreign keys.