Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Database Design
> 1. I proposed a design with one column in table for each checkbox in
> the screen. If a checkbox is selected "1" will be stored in the
> corresponding column else "0" will be stored. For the checkboxes with
> caption "Other" the text entered in the text box will be stored
Making a schema for just what you need today is a bad thing!
Design it so that you link out to another table to discern the information.
In the example below you would query the OptionType Table for a list of all the available options.
When the customer chooses the ones they want from your form, you write them back to the CustomerOptions Table.
I have included CustomerAddress so you get a feel for whats going on... basically you are trying to ensure that there is always a way to scale up the capabilities of your database without re-writing the schema.
While youre at it, build in the date created/updated (and by whom). That little step will save you thousands of dollars, many many hours... I just can't stress having an auditing capability enough!
Using a Lookup Table for 'magic numbers' and field translations is a wise idea as well... When taken to the extreme, you wind up with one table to translate if you ever go international,
Customer
CustomerOptions
OptionType
CustomerAddress
Lookup