Forums

Help with table structure

Twincarb 20 Feb, 2017
Hi,

For one of the sites that I maintain I am looking to create a form for adding hospitals including address and wards. The end aim will be to retrieve the data stored into another form in order to select a hospital name and then ward name in a double dropdown. What I can't decide in my mind is the method to save all the information into the database.

My initial thoughts are to have:
a single table for the hospital names
a single table to hold the address in separate columns
a single table to hold each of the wards one ward per column

These would all be linked by sharing the same "id" as the hospital so a query on a hospital would be able to select the additional attributes.

Any thoughts on setting it up this way or possibly a better or simpler way of doing it?

Regards,
Dave
GreyHead 20 Feb, 2017
Hi Dave,

If each hospital only has one address then you could combine the first two tables, the third table looks good - but it would be one ward per row (not per column).

Bob
Twincarb 20 Feb, 2017
Hi Bob,

Thanks that does make sense now I think about it again... Just need to find the time to put the forms together now, worst bit will be to enter all the required details into the completed form I think!

Regards,
Dave
This topic is locked and no more replies can be posted.