Wednesday 7 November 2012

Create sqlite Database using Terminal


Last login: Wed Nov  7 15:47:36 on ttys001
Samiflabs-21:~ samirvohra$ sqlite3 sound.db;
SQLite version 3.6.12
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE 'sound' ('id' integer PRIMARY KEY AUTOINCREMENT, 'sha' text, 'file' blob); CREATE INDEX 'sound_sha_index' ON 'sound' ('sha');
sqlite> .tables
sound
sqlite> insert into 'sound' values(kd,kd);
SQL error: no such column: kd
sqlite> insert into 'sound' values('kd','kd');
SQL error: table sound has 3 columns but 2 values were supplied
sqlite> insert into 'sound' values(1,'kd','kd');
sqlite> select * from sound;
1|kd|kd
sqlite> insert into 'sound' values(2,'kds','ds');
sqlite> select * from sound;
1|kd|kd
2|kds|ds
sqlite> .exit
Samiflabs-21:~ samirvohra$ 


No comments:

Post a Comment