Answer the question
In order to leave comments, you need to log in
How to properly design a database structure in sqlite for an android application?
I'm going to write an application for testing. There is such a structure of the database
1. Each question can have any number of answer options,
2. Each question can have any number of correct answers,
3. Each question can consist of several categories,
4. Each answer option can be reused by different questions (may be correct in one question, wrong in another)
As for point 4, maybe it's worth removing the reuse and saving all the options entered by the user in a separate file and showing them in the AutoCompleteTextView when entering, and in the database in plain text instead of a separate table?
When adding an existing question to another category, it becomes necessary to copy records, the number of which matches the number of n options (copying occurs in CategoryQuestion (1 record) and in QuestionOption (n records)
Do sqlite use any ORM, or direct sql-
UPD:
I changed the structure a little:
2 foreign keys for the same field - is this normal or should not be done this way ?
Answer the question
In order to leave comments, you need to log in
It's easier with requests, less hassle, but learning ORM is a good thing, it will make life easier in the future.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question