Hi,
I want to create a table like this:
ID Autonum
Datefld Date
Cat Text
Itm Text
tCount Number
Data would look like this:
Data would look like this:
ID Datefld Cat Itm tCount
1 1/1/03 A itm1 3
2 1/1/03 A itm2 4
....
20 1/1/03 A itm20 2
21 1/1/03 B itm1 4
22 1/1/03 B itm2 5
....
40 1/1/03 B itm20 7
....
121 1/1/03 G itm1 8
....
140 1/1/03 G itm20 14
141 1/2/03 A itm1 7
....
160 1/2/03 A itm20 16
161 1/2/03 B itm1 9
....
281 1/3/03 A itm1 22
....
There are 7 categories A, B, C,... G. Each category
contains 20 Items per day, and a count of each item in
each category for each day. Someone at my place is telling
me that the correct way to create my table to to have 2
tables Master Table, Detail Table.
The Master table would contain the ID field, Date field,
and Cat field. The Detail table would contain the ID
field, Itm field and Count field. The argument is that
each category should be listed only one time per day, and
relate to the Detail table by ID. Data would now look
like this:
Master Table
ID Datefld Cat
1 1/1/03 A
2 1/1/03 B
...
7 1/1/03 G
8 1/2/03 A
Detail Table
ID Itm tCount
1 itm1 ...
1 itm2 ...
....
1 itm20 ...
2 itm1 ...
....
This seems a little redundant to me. You have less rows
in the Master table but the same number of rows in the
Detail table as with my original plan of using just one
table. The second design contains an extra column and an
extra table and joins I would now have to deal with.
So my question is - for my purposes - just to query count of items per
category per date range (real basic queries),
which of the 2 designs described here is more
correct/practical? Any suggestions appreciated.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!