Note that there are some explanatory texts on larger screens.

plurals
  1. POSqlite schema for android application
    primarykey
    data
    text
    <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>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload