Sqlite schema for android application
<p>I am developing an Android application that queries various statistics from a static on-phone database about cars, such as acceleration, engine displacement, doors, etc. I need to specify the format of the database from the client. The UI needs to be able to show a sorted list of information for a particular attribute from multiple cars, such as engine displacement, or cost, AND another view that shows all the attributes for a particular car.</p>

<p>My first thought, rather than creating a table with a column for each attribute: (which is what, 1st normal form?)</p>

<pre><code>Cars:
ID - integer primary key
Make - text
Model - text
HorsePower - Real
Acceleration - Real
Doors - INteger
etc..
</code></pre>

<p>Do this instead:</p>

<pre><code>Cars
ID - integer primary key
Make - text
Model - text

CarAttributes:
ID - integer primary key
DisplayName - Text   (that gets shown as a column header, or for a line)
Unit - Text (a short unit suffix that gets appended to the value such as mph)

Values:
ID - integer primary key
CarID - foreign key
CarAttributeID - foreign key
Value - Real
</code></pre>

<p>This allows the view, given the CarID and the AttributeID to perform a couple queries and just display the results. With the first form, the view would have to somehow know what units/display name goes with what columns.</p>

<p>Is this a reasonable way to request they send me the schema? In other words, if you had a request to provide the data in that schema would you say "ooh gross!"?</p>

<p>Edit: Added example of first schema, and provided more clarity.</p>
