Boost PC performance: How more available memory can improve productivity
SQLite: Light, Open Source Relational Database Management System
1. Light, Open Source RDBMS
SQLite
Tanner Jessel
Spring 2014
IS 592 - Big Data Analytics
School of Information Sciences
College of Communication & Information
2. • Big Data in a Little
Package
– Portable, No Server
– Writes directly to
common media
– Cross-platform (Mac,
Windows, Linux)
What is SQLite?
3. • Portable
– Small Gadgets (Windows
Phone, Android, iOS)
• (500 KB, 300 KB)
• Embeddable
– Computer Applications
(Chrome, Firefox, Skype)
• Single file database
– Triggers
– Tables
– Indices
– Views
What is SQLite?
4. • Not a full database
application
– No forms
– No reports
– No saved queries
What it is not…
5. *Free*
• No Server (no mess)
• Command Line Interface
• GUI Interface
• Works with R
• Works with Python
• Good for students to learn advanced SQL
queries, command line interaction
• Good for small database projects
Why should you be interested?
7. “Database Interface R driver for SQLite. This
package embeds the SQLite database engine in
R and provides an interface compliant with the
DBI package. The source for the SQLite engine
(version 3.7.17) is included.”
–Comprehensive R Archive Network (CRAN)
http://cran.r-project.org/web/packages/RSQLite/
RSQLite
8. Sqlite3
http://www.sqlite.org/cli.html
Command Line Shell
$ sqlite3 myexampledb
SQLite version 3.8.4 2014-02-11 16:24:34
Enter ".help" for usage hints.
sqlite> CREATE table tbl1(one varchar(10), two
smallint);
sqlite> INSERT into tbl1 values('hello!',10);
sqlite> INSERT into tbl1 values('goodbye', 20);
sqlite> SELECT * from tbl1;
hello!|10
goodbye|20
sqlite>
9. *Free*
• Feature Rich GUI
• Cross-platform
– Windows
– Mac
– Linux
– Solaris
• http://sqlitestudio.pl/
SQLite Studio
20. Quality Assurance / Control
• Find, list “errors”
• Whatever you define
them to be
• > 100 F in Antarctica,
for example
c.execute('SELECT
obsNum,serialNo,temperatureF
FROM newTable
WHERE temperatureF > 100 OR
temperatureF < 10')
21. Quality Assurance / Control
• Check for Errors
• Nice printed
messsage with your
selected “errors”
• python
QAQCdemo.py
#Fetch all the query results
myListOfNames=c.fetchall()
# print them out
print
print("Range Errors for
Temperature:")
for myTuple in myListOfNames:
print("obsNum:
"+str(myTuple[0])+" SerialNo:
"+str(myTuple[1])+" Temperature:
"+str(myTuple[2]))
conn.commit()
conn.close()
22. 'SELECT obsNum,serialNo,temperatureF FROM newTable
WHERE temperatureF > 100 OR temperatureF < 10'
>100 F: SQLite/Python QAQC
1,538 records where the temperature was over 100 F