Posted By

chrisaiv on 11/02/08


Tagged

sqlite3


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

IsraelTorres
tof


SQLite3 Basics


 / Published in: SQL
 

If you come from a MySQL background like me, these may come in handy. http://www.sqlite.org/sqlite.html

  1. #Create a database
  2. bash$ sqlite3 <database>
  3.  
  4. #See a list of the tables in the database
  5. sqlite> .TABLES
  6.  
  7. #Quit SQLite3
  8. sqlite> .quit
  9.  
  10. #Create a Table and insert a couple of values
  11. sqlite> CREATE TABLE tbl2 ( f1 varchar(30) PRIMARY KEY, f2 text, f3 real);
  12. sqlite> INSERT INTO tbl1 VALUES('hello!',10);
  13.  
  14. #Select * from a table
  15. sqlite> SELECT * FROM tbl1;

Report this snippet  

You need to login to post a comment.