O
OrdinarySoul
Hi,
I am currently using a lookup table to populate the values in a
listbox.
columns:
item_id number
item_name text
values:
item_id item_name
1 item_A
2 item_B
3 item_C
.....
With item_A being the default that's automatically selected when the
listbox displays.
Now I've added the feature to allow users to update which item they
want to use as the default. So I need to track the default value in
the database. There are two options I can think of:
1. Add a column to the table indicating if a row is the default
value:
item_id number
item_name text
default boolean
This option could work, but waste some unnecessary space.
2. Use a table with only one field, one row to store the default
value:
Table default_item:
item_id number
This option would not take up a lot of space, but the query for the
listbox would be more complicated, with a join.
So, can anyone think of any other options that might be simpler,
faster, easier to implement? Thank you very much for your ideas.
I am currently using a lookup table to populate the values in a
listbox.
columns:
item_id number
item_name text
values:
item_id item_name
1 item_A
2 item_B
3 item_C
.....
With item_A being the default that's automatically selected when the
listbox displays.
Now I've added the feature to allow users to update which item they
want to use as the default. So I need to track the default value in
the database. There are two options I can think of:
1. Add a column to the table indicating if a row is the default
value:
item_id number
item_name text
default boolean
This option could work, but waste some unnecessary space.
2. Use a table with only one field, one row to store the default
value:
Table default_item:
item_id number
This option would not take up a lot of space, but the query for the
listbox would be more complicated, with a join.
So, can anyone think of any other options that might be simpler,
faster, easier to implement? Thank you very much for your ideas.