2. Open source RDBMS Single file database Cross Platform database Works as library instead of service What is SQLLite ?
3. Features : Transactions are ACID No setup or administration need to use Implements most of SQL-92 Support terabyte size of database Faster than popular RDBMS in some cases
4. Benchmark - INSERT 1000 INSERTs CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100));INSERT INTO t1 VALUES(1,13153,'thirteen thousand one hundred fifty three');INSERT INTO t1 VALUES(2,75560,'seventy five thousand five hundred sixty');... 995 lines omittedINSERT INTO t1 VALUES(998,66289,'sixty six thousand two hundred eighty nine');INSERT INTO t1 VALUES(999,24322,'twenty four thousand three hundred twenty two');INSERT INTO t1 VALUES(1000,94142,'ninety four thousand one hundred forty two'); 25000 INSERTs in a transaction BEGIN;CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100));INSERT INTO t2 VALUES(1,59672,'fifty nine thousand six hundred seventy two');... 24997 lines omittedINSERT INTO t2 VALUES(24999,89569,'eighty nine thousand five hundred sixty nine');INSERT INTO t2 VALUES(25000,94666,'ninety four thousand six hundred sixty six');
5. Benchmark - SELECT 100 SELECTs without an index BEGIN;SELECT count(*), avg(b) FROM t2 WHERE b>=0 AND b<1000;SELECT count(*), avg(b) FROM t2 WHERE b>=100 AND b<1100;... 96 lines omittedSELECT count(*), avg(b) FROM t2 WHERE b>=9800 AND b<10800;SELECT count(*), avg(b) FROM t2 WHERE b>=9900 AND b<10900;COMMIT; 100 SELECTs on a string comparison BEGIN;SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%one%';SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%two%';... 96 lines omittedSELECT count(*), avg(b) FROM t2 WHERE c LIKE '%ninety nine%';SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%one hundred%';
6. Benchmark - UPDATE 1000 UPDATEs without an index BEGIN;UPDATE t1 SET b=b*2 WHERE a>=0 AND a<10;UPDATE t1 SET b=b*2 WHERE a>=10 AND a<20;... 996 lines omittedUPDATE t1 SET b=b*2 WHERE a>=9980 AND a<9990;UPDATE t1 SET b=b*2 WHERE a>=9990 AND a<10000;COMMIT; 25000 UPDATEs with an index BEGIN;UPDATE t2 SET b=468026 WHERE a=1;UPDATE t2 SET b=121928 WHERE a=2;... 24996 lines omittedUPDATE t2 SET b=35065 WHERE a=24999;UPDATE t2 SET b=347393 WHERE a=25000;COMMIT;
7. Benchmark - DELETE DELETE without an index DELETE FROM t2 WHERE c LIKE '%fifty%'; DELETE with an index DELETE FROM t2 WHERE a>10 AND a<20000;
8. Features : Transactions are ACID No setup or administration need to use Implements most of SQL-92 Support terabyte size of database Faster than popular RDBMS in some cases Cross Platform Unix(Linux and Mac OS X) , OS/2 , Windows Comes with a standalone command line interface
9. Disadvantages : Problem with foreign keys Single user Not supported stored procedures Low speed on large tables No security facility Problem with sorting Unicode data Problem with 64bit systems
10. Uses of SQLite: Application file format Database for gadgets Website database Enterprise and dedicated RDBMS
11. How to use: Include files Command Line Shell Interfaces http://www.sqlite.org/download.html http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers