From: Kariem H. <ka...@us...> - 2007-08-29 08:17:59
|
On 8/29/07, Christopher Oezbek <oe...@oe...> wrote: > TABLE entries > > col1: ID > col2: type (is a string) > col3: author > col4: editor > col5: title > ... > ... All the required and optional fields (you can look these up from > JabRef) > ... > > TABLE customFields > col1: ID (as a foreign key into entries table) > col2: fieldName (for instance for holding ISBN) > col3: fieldValue > > It is of course possible with the dynamical approach to put the > customFields into the entries table as well. I am with Chris on this point. This approach would reduce the redundant information you would have constructed with the table-per-entry-type approach. All common attributes are in one table. The dynamic character of the "customFields" table might also be better for your use case. > TABLE groups > col1: ID (as a foreign key into entries table) > col2: group (as a string label for the group) I think you need two tables here: - groups should only hold IDs and labels of the groups - an additional table to map the entries to the group (m:n): TABLE groups col1: ID (no foreign key) col2: group (label, as Christopher proposed) TABLE groupEntries (weak entity) col1: entryId (foreign key into entries.id) col2: groupId (foreign key into groups.id) The entity names should all be plural or singular, not mixed (although I prefer having table names in singular). Greetings, Kariem |