My preference is to create a file with an editor to spell out the tables and 
some example inserts and selects to test.  Then you can easily just make some 
changes and re-read the file to test it again.



Then you can run the sqlite shell and do this (example file is myfile.sql that 
you create) containing:

drop table if exists mytable;

create table mytable(field1,field2);

insert into mytable values(1,2);

insert into mytable values(3,4);

select * from mytable;



Then run this to create database named "my.db"

sqlite3 my.db

sqlite> .read myfile.sql

1|2

3|4

sqlite>







Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems

________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of McSparin, Brett E [brett.e.mcspa...@boeing.com]
Sent: Thursday, May 10, 2012 3:26 PM
To: sqlite-users@sqlite.org
Subject: EXT :[sqlite] intial database creation

How does one go about creating a database initially in SQLite?
Do you create a schema file for it to read or similar?
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to