ICS 184: Database Systems
Assignment 2
The Personal Database Application (PDA) we will be implementing is the Space Project (well call the Space Database System SDS). Requested by Candy Mamer, an administrative staff in ICS department, the Space Project is to facilitate space management of the whole ICS department. Typical purposes of Space Database System include:
A convenient user interface (details are to be discussed with customer later!) | |
Ability to generate a variety of reports, e.g., ICS Space Summary, Space used by different Research Areas, which rooms are empty, and which rooms are occupied and by whom, etc. | |
And, more query operations, which will be discussed with customer later. |
Described below is an entity-relationship diagram for the Space Database System.
SS#, Account#, and Branch# are key for each...
SS# |
Account# |
Branch# |
123456 |
1001 | 1 |
123456 | 1003 | 1 |
654321 | 1005 | 100 |
The relationship <CAB> in ER1 specifies that each pair of (customer, account) has exactly on branch; each pair of (customer, branch) relates exactly to one account, and so each pair of (branch, account) with one customer. The data above inherently violate the rules!
ER2 allows pair (customer, branch) to have more than one account... and thus the above data conforms the ER2 schema. Similar arguments will be applied for the next questions!
SS# |
Account# |
Branch# |
123456 |
1001 | 1 |
123456 | 1003 | 1 |
654321 | 1001 | 1 |
SS# |
Account# |
Branch# |
123456 |
1001 | 1 |
123456 | 1001 | 2 |
123456 | 1003 | 1 |
654321 | 1001 | 1 |
In the above schema Orders is the weak entity set and dependent on the strong entity sets, Customers and Items. The problem is that an Orders entity does not have a Discriminator and, therefore, there is no way to correctly identify a particular Order among others. Another "bug" is alive in the relationships between Orders and Customers, and Items. According to the schema above, an Orders entity could have neither relation with Customers nor Items, which is inconsistent!
One way to solve the problem is to add an attribute, OrderNumber, to the weak entity Orders to act as the discriminator for this weak entity set. Also, make a constraint that the relations between Orders and Customers & Items to be TOTAL, so that a weak entity must have a relation to some strong entity.