Question How to best organize my database

keb1965

Well-known member
Joined
Feb 9, 2009
Messages
103
Programming Experience
10+
I am using a database to store information about a dynamic program where the user can define new widgets based on one of 3 templates.

Currently in the database there is no relationships between tables and items, and I essentially query the tables for the corresponding table to the widget name.

Example:

Widgets has 6 columns
ID | Name | Type | Title | Caption1 | Caption2

Each widget has a list of relational data that corresponds to only one widget and can varies in row count.

That table contains 2 columns
ItemName
ID | Scenario

When the widget is loaded, the basic attributes are set according to the "widgets" table, then we search for a table named the same as the item in "widgets.Name" and then load all of the scenarios and values into a datalist.

I don't necessarily need to bind this data to my widget as it is read only except in design mode.

Additionally, each item in the "scenario" column has a scoring model that may have any number of values assigned

ItemNameScenarioX
ID | Description | Score

For a single widget, without too many options, I have 1 widget table, 1 scenario table, and 8 score tables

That is 10 tables for a single item, and some of the widgets will need to have as many 20, depending upon the number of options the user selects when building the widget from the template.

I hope I explained it well enough that it was understood.
 

Latest posts

Back
Top