N
N
New York Knicks2015-02-19 14:50:55
Android
New York Knicks, 2015-02-19 14:50:55

What is the best way to store records in a database (Android App)?

There is a task to write an organizer for storing records: notes, tasks.
Moreover, the function of converting a note into a task should be implemented (at the same time, attributes are added: priority, due dates, reminder time, repetition, etc.).
Both notes and tasks also have common fields: title, text, date of creation
Question: which implementation will be more convenient and less resource-intensive?
1) Create 2 tables: for notes and tasks. In case of note conversion, create a new entry in tasks, filling it with existing information (note text).
2) Store everything in one table with all the attributes common to the two types.
For example, there will be a field that defines the record type, depending on the type, some fields will be inactive (null/0 or something else). It turns out that for conversion it will only be necessary to change the record type and fill in the empty fields.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Martyanov, 2015-02-19
@vilgeforce

I'm for option #2, IMHO there will be less trouble. I would even suggest not to use a field for the type (note/task), but to use a "run time" field, which is null for a note and not for a task.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question