Remember: the due time/day of 11AM Wednesday applies to you too, although we often cannot verify the exact time you delivered your work to your local pickup point. However, please do not imagine, say, that it is OK to hand-deliver the work Thursday morning.
Your first step is to identify the domain you would like to manage with your database, and to construct an entity-relationship diagram for the data. We suggest that you pick an application that you will enjoy working with, since you'll be stuck with it for the whole quarter! In previous years, students who built a database about something they were interested in--a hobby, material from another course, a research project, etc.--got the most out of this part of CS145.
Try to pick an application that is relatively substantial, but not too enormous. For example, when expressed in the entity-relationship model, you might want your design to have in the range of five or so entity sets, and a similar number of relationships. Note that this is a ballpark figure only! You should certainly include different kinds of relationships (e.g., many-one, many-many) and different kinds of data (strings, integers, etc.), but your application need not necessarily require advanced features such as subclassing or weak entity sets.
Don't forget to save a copy of your PDA for reference as you do Step 2 of the PDA.
If you are having trouble thinking of an application, or if you are unsure whether your proposed application is appropriate, please feel free to consult with one of the course staff.
if(x == y) {
a = b;
c = d;
}
shows an if-statement, whose body is a block, and within that block
are two assignment statements.
The if-statement has a condition (x == y), as well as a
body.
This if-statement has no ``else part,'' however.Design an E/R diagram in which Statement, Condition, and Identifier (a variable, such as x or a above) are important entity sets. Different kinds of statements have different constitutents. For example, if-statements (without else) have a condition and a statement that is the body of the if-statement.
Blocks have zero or more statements in a list. Your E/R diagram should represent the different kinds of statements and provide enough structure so that the data (entities and relationship sets that form the actual database) would allow us to determine the constituents of each statement of a program (e.g., that the particular if-statement shown above has the block {a=b;c=d;} as its body and the expression x==y as its condition). It is appropriate to invent a key attribute used to identify each statement. Your diagram should also allow us to tell which identifiers appear in which assignment statements and in which conditions.
If the above specifications are not completely clear, you may resolve ambiguities in any reasonable way; just tell us what you assume.
/ \
|---| / \ |---|
| A |<------------- ------------->| B |
|---| \ / |---|
\ /
|
|
|---|
| C |
|---|
There is a correct interpretation, which is that, given A and C
entities, there is at most one related B entity, and, given B
and C entities, there is at most one related A entity.
There is also an incorrect interpretation ``given a C entity,
there is at most one related A entity and at most one related B
entity.''