Data fields always occur at the tips of the branches, i.e., always to the right of the rightmost label on a branch. A branch can be followed by more than one field. The preceding section, in which ?TShirt is transformed into a tree diagram, may make this more obvious.
There are various kinds of data fields in ACEDB. Here are some simple ones and examples of what you can put in them.
field can contain examples ------------------------------------------------------------------- Text nearly anything! "Hi Sam", 22, or 5.5 Int numbers w/o decimal points 22, but not "Hi Sam" or 5.5 Float numbers w/ or w/o decimals 22 or 5.5, but not "Hi Sam"All three are represented in ?TShirt. For example, the model contains
Price Float Year Int Remarks TextSince a Text field can accomodate just about anything, why use Int or Float at all? The reason is that computers store the numbers differently from text. The number 2 is different from the character "2" even if they look the same way on the screen. The difference becomes important when you are interested in comparing two numbers in a query, perhaps using "greater than" or "less than". Also, Int (and Float) fields impose useful restrictions. You cannot enter "12a" in an integer field by mistake.
A label can be followed by more than one field as in
Damage Text Text //description and date
The last field is potentially confusing; the label doesn't
unambigously identify what are the two fields supposed to contain. In
fact the comment is there to let you know that the left Text field
contains a description of the damage and the right field the date the
damage occurred. However, users will not see the comment; it exists
only in the models file for the benefit of the curator. Perhaps a
better design would have been
Damage_and_date Text Text //description and date
Damage Description Text Date Text //***WRONG***
where "Damage", "Description", and "Date" are labels. This would be a
violation of the rule that fields must appear to the right of the
rightmost label on a branch. There are ways to circumvent this
restriction which we will discuss later.
Back to Table of Contents