android - How to structure this DB in SQLite? -


i creating form saves input in sqlite database in android. first part relatively simple , common database rows (name, age, occupation, etc.).

the last part, however, depends on user's choice. example: if user chooses hobby hiking, form display unique questions unique table entries. if chooses hobby gardening, there different table entries , on.

how can achieved in best way? suspect has other tables , foreign keys, can point me in right direction?

a simple key value set of tables may easy solution:

selected topic | associated question key   question key | question # | question 

this 2 table structure allow based off of selected topic , questions topic. depending on how survey structured, database schema need change (for example multiple different paths, fixed # questions, etc). basic outline should provide basis dynamic form


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -