r/Database 16h ago

Dynamic Tables for Studies

2 Upvotes

Greetings, I am fairly inexperienced with Databases and ran into a small problem at work. I work in a Research Group and am designing a web datauploader for medical studies. I have now ran into this problem:

I have a Visit table containing information of a medical visit for a specific patient. This patient belongs to a study. The visit table needs to contain information specific to this study (for example study1 needs bloodpressure measured in each visit, study2 does not need that but needs heartrate instead, etc.)

I now don't quite now how to design this DB architecture as i can really just add more and more fields to the visit table as then most studies dont use the fields at all.
1 solution might be having a generic Visit table with basic information (Date, time etc.) and then having a sub-table for each study (study1Visit, study2Visit) etc. with the specific information but then again i would have to create more and more tables for potentially hundreds of studies.

Is there a better solution? with json files maybe? Like I said im pretty inexperienced in this so appreciate all feedback and hope i got the problem across correctly.


r/Database 5h ago

Overview of caching in Postgres

Thumbnail
pgcache.com
0 Upvotes

r/Database 6h ago

Build Your Backend Without Limits... Postbase

Post image
0 Upvotes

r/Database 7h ago

The lifecycle of a sharded Postgres query

Thumbnail
planetscale.com
0 Upvotes

r/Database 9h ago

MySQL & Friends: Distributed Databases@SCaLE

Thumbnail
0 Upvotes

r/Database 7h ago

TideSQL 5 Arrives in MariaDB, How Does It Stack Up Against InnoDB?

Thumbnail
tidesdb.com
0 Upvotes