Database design

Hello Friends,
I just wanted to know the proper way of designing a database which
should
be worked with the activerocord design.
My requirement is

I have 100’s of question and answer to that question, and the scenario
is
that a user will select the answer which will be used for the future
reference.
As we have to keep in mind that the answer can be in any format like - a
number, text, date, datetime, checkbox, radiobutton.

So I have a YAML file to store the question and answer? Or it should in
a
database.,

So it will be very much helpful if you suggest me how should I design a
Database on the above mentioned requirement.

Thanks
Abhis.

Pluralised table names and id autoincrementing integer as your primary
key. Use underscores between words all lowercase and foreign keys have
singularised versions of the table name. For example great_questions
as a table name and great_question_id as a foreign key. Don’t use
constraints if you can help it.

Blog: http://random8.zenunit.com/
Twitter: http://twitter.com/random8r
Learn: http://sensei.zenunit.com/
New video up now at http://sensei.zenunit.com/ real fastcgi rails
deploy process! Check it out now!

Julian L. wrote:

Pluralised table names and id autoincrementing integer as your primary
key. Use underscores between words all lowercase and foreign keys have
singularised versions of the table name. For example great_questions
as a table name and great_question_id as a foreign key.

Right.

Don’t use
constraints if you can help it.

Fatally wrong! Constraints are essential to a database that will not be
corrupted by inconsistent data. Do not leave them out.

Blog: http://random8.zenunit.com/
Twitter: http://twitter.com/random8r
Learn: http://sensei.zenunit.com/
New video up now at http://sensei.zenunit.com/ real fastcgi rails
deploy process! Check it out now!

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs