Thursday, February 9, 2012

Advise on database layout

I'm trying to build a web application that would input user data from a
web page to a SQL Server database and I need help laying out the
database.
The web page will ask for user input on their employement status and
look something like this...
JobClassCategoryFull TimePart Time
GovernmentFederal()()
State()()
Local()()
Other(Specify)()()
IndustrialLaboratory()()
Agricultural()()
Nutrition()()
Other(Specify)()()
OtherAssociation()()
Service()()
Retired()()
Other(Specify)()()
Those are radio boxes in the Full Time and Part Time columns. There
will be a text box where they can specifiy if they choose "Other".
So far my db is laid out like this.
Table: JobClass
ClassID int (PK)
ClassDesc Varchar(50)
Table: JobCategory
ClassIDint (PK)
CategoryIDint (PK)
CategoryDescvarchar(50)
Table: JobType (used for Full or Part Time)
JobTypeIDint (PK)
JobDescvarchar(20)
Table: Member_Employement
MemberIDint (PK)
ClassIDint (PK)
CategoryIDint (PK)
JobTypeIDint
Othervarchar(50) (Used if they select other)
I'm not sure if this is the best way to lay it out. I'm not sure how
to handle the situations where the user selects "other". Right now
they would type it into a text box on the web page and I would store it
in the other field in the Member_Employment table. Does anyone have
any thoughts?
Is the data in the Other selection fixed?
If yes then create another table that holds the values that must exist for
Others selection and let the user select from a combobox/dropdown box.
If the values for Other is not fixed, there is no problem in permitting the
user to enter it.
Is the solution clear and does it answer your question
thanks and regards
Chandra
"mpsmith-j-quin@.excite.com" wrote:

> I'm trying to build a web application that would input user data from a
> web page to a SQL Server database and I need help laying out the
> database.
> The web page will ask for user input on their employement status and
> look something like this...
> JobClassCategoryFull TimePart Time
> GovernmentFederal()()
> State()()
> Local()()
> Other(Specify)()()
> IndustrialLaboratory()()
> Agricultural()()
> Nutrition()()
> Other(Specify)()()
> OtherAssociation()()
> Service()()
> Retired()()
> Other(Specify)()()
>
> Those are radio boxes in the Full Time and Part Time columns. There
> will be a text box where they can specifiy if they choose "Other".
> So far my db is laid out like this.
> Table: JobClass
> ClassID int (PK)
> ClassDesc Varchar(50)
> Table: JobCategory
> ClassIDint (PK)
> CategoryIDint (PK)
> CategoryDescvarchar(50)
> Table: JobType (used for Full or Part Time)
> JobTypeIDint (PK)
> JobDescvarchar(20)
> Table: Member_Employement
> MemberIDint (PK)
> ClassIDint (PK)
> CategoryIDint (PK)
> JobTypeIDint
> Othervarchar(50) (Used if they select other)
> I'm not sure if this is the best way to lay it out. I'm not sure how
> to handle the situations where the user selects "other". Right now
> they would type it into a text box on the web page and I would store it
> in the other field in the Member_Employment table. Does anyone have
> any thoughts?
>
|||The values for Other is not fixed and the user will enter it in a text
box on the web page. I'm just not sure I'm laying out the database the
best way to handle it.

No comments:

Post a Comment