Dear All,

im given a hard copy of a form that is used by a hospital to gather information about its patients ! the form is divided into sections and each section has A LOT of YES/NO check boxes.


For example, one of the section is the History section that has more than 20 unrelated yes/no fields:

smoker ( yes or no)

diabetes (yes or no )

Chronic Lung (yes or no )
.
.
.
.
.

Another section is the "stress test data" section that has questions like the following:

Standard test (yes/no) , if yes , what are the results ( negative or positive),
if positive ( what is the extent (low or high, or intermediate )

...

i am asked to design a database, show the relation tables and the relation between them ! :S:S this is looks NOTHING like the "student-class database" or the "CD company database" i came across ! this is just..i dont know..DYNAMIC :s:s

i got the patient table that has ( ID , name, sex ...) . but im so lost about the other table !! if you look at the history section i talked about above,
If i put all of these (smoker, diabetes..) in one table called HISTORY, its not efficient at all ! because if the patient checks the smoker field and leave the other 19 unchecked because they don't apply, we will have wasted place in the table of that patient ...so im really lost !

i have NO IDEA how to even START designing this database or what are the things that i should read or look into or pratice in order to design a database for such a form !!

PLEASE HELP !!

You really have no useful choice about wasting space for unanswered questions: You can have a lot of little tables, one for each question, each holds a foreign key: patient_history.id and the various answer fields; or you can have one wide table that has a lot of nullable answer columns. At least those columns take very small space in the database because most are boolean which is small.

The complexity of a query that joins dozens of tables is sufficient to make me prefer the 'one wide table' answer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.