|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Hi Everyone,
I have a question about database design... I have a table that has a column in which the user can choose between a set of values (combo box)... But ... depending on which value the user chose i want to store certain extra information... EG User can choose between these 3 values... Hair Eyes Teeth If the user chooses Hair i would like to record the color aswell as the length... If the user chooses Eyes i would like to record the color only. If the user chooses Teeth i would like to record the number of upper teeth and the number of lower teeth... I hope this example explains what im trying to do... Thanks in advance. Dane Harnett |
|
#2
|
||||
|
||||
|
You can do this two ways. One would be to make the table with three columns; when the choice is eyes, one field is left blank. The key is to not get caught up in the name of the column itself.
Code:
table
part SET('eyes','hair','teeth')
extra1 // color, color, upper
extra2 // null, length, lower
Code:
table1
ID
part SET('eyes','hair','teeth')
table2
partID
extra SET('color','length','upper','lower')
value
|
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Database Design - store extra info based on user input |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|