title: Android - relational database SQLite with multiple tables
body: <p>I'm trying to build a database using 21 tables each bind with constraints. I have implemented the database in PHPmyAdmin  and then download the structure script to import in my Android SQLite database.</p>
  
  <p>But I would like  to know what are the good practices in building relational databases with many tables in Android, and how to create them.</p>
  
  <p>currently I have a class implementing SQLiteOpenHelper:</p>
  
  <pre><code>public class SqlSig extends SQLiteOpenHelper {
  
  @Override
  public void onCreate(SQLiteDatabase db) {
      for(int i = 0; i != ConfigBDD.requetes.length; i++){
          db.execSQL(ConfigBDD.requetes[i]);
      }
  }
  }
  </code></pre>
  
  <p>ConfigBDD.requetes[i] fetch a string array containing tables creation requests and constraints requests. This code doesn't work at all, and logCat show an error with the PRIMARY KEY instruction:</p>
  
  <pre><code> 05-29 15:13:51.992: E/Database(8187): Failure 1 (near "KEY": syntax error) on 0x15c4b8
   when preparing 'CREATE TABLE IF NOT EXISTS `arret` ( `id` int(11) NOT NULL , `id_externe`
   varchar(10) DEFAULT NULL, `id_pid` int(11) NOT NULL, `nom` varchar(50) NOT NULL,
   `description` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `id_pid` (`id_pid`) )
   DEFAULT CHARSET=utf8 =1 ;'.
  </code></pre>
  
  <p>I am pretty sure there are other ways to create this database but did not found any explanations about multi tables Android SQLite database creation...</p>