SQLite - CourseReps/ECEN489-Fall2015 GitHub Wiki

#Brief introduction SQLite is an embedded SQL database engine, it is self-contained, serverless, zero-configuration, transactional. The code for SQLite is in the public domain and is thus free for use for any purpose.

##Getting started with SQLite

###Download

  • Get a copy of the prebuilt binaries for your machine, or get a copy of the sources and compile them yourself. Visit the download page for more information. If you have some problems in compiling SQLite, you can follow the instruction here.

###Basic commands

  • Create a database

      sqlite3 <name>.db
    
  • Create a table

      create table <table name>(<col1 name> <col1 type>, ..., <coln name> <coln type>);
    

It have 5 datatypes, NULL, INTEGER, REAL, TEXT, BLOB

  • Insert a row

      insert into <table name> values(<value 1>, <value 2>, ..., <value n>);
    
  • Fetch data in the table

      select * from <table name>; //get all the data in the table and display them
    
      select <col1>, <col2>, ..., <coln> from <table name>; //get the data from the columns listed above and display them
    
  • Delete a row

      delete from <table name> where <col name> = <col value>;
    
  • Modify the table data

      update <table name> set <columnn> = <new value> where <column1> = <value>
    
  • Delete the table

      drop table <table name>;
    

You can find more commands here

##References http://sqlite.org/

http://www.tutorialspoint.com/sqlite

##Useful link http://sqlite.org/cintro.html

⚠️ **GitHub.com Fallback** ⚠️