Download Introduction to Sqlite and its usage with python 1. Sqlite : SQLite is a

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Entity–attribute–value model wikipedia , lookup

Serializability wikipedia , lookup

Microsoft Access wikipedia , lookup

IMDb wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Btrieve wikipedia , lookup

SQL wikipedia , lookup

Functional Database Model wikipedia , lookup

Oracle Database wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Ingres (database) wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Database wikipedia , lookup

Concurrency control wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

PL/SQL wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Clusterpoint wikipedia , lookup

ContactPoint wikipedia , lookup

Transcript
SQLite
Dhananjay(123059008)
Introduction to Sqlite and its usage with python
1. Sqlite :
SQLite is a software library that implements a self-contained, serverless, zeroconfiguration, transactional SQL database engine. SQLite is the most widely
deployedSQL database engine in the world. SQLite is a software library that
implements a self-contained, serverless, zero-configuration, transactional SQL
database engine.
To install :
$ sudo apt-get install sqlite3 libsqlite3-dev
To create a data base, we only need to create a empty file :
$ touch ex1.db
To connect to database through sqlite :
$ sqlite3 ex1.db
There are various shells and command lines available for manipulating Sqlite
databases.
2. SQLite Database browser
It is a light GUI editor for SQLite databases. It can be used as a basic database
management system.
3. Using python library sqlite for manipulating databases :
SQLite is a C library that provides a lightweight disk-based database that doesn’t
require a separate server process and allows accessing the database using a
nonstandard variant of the SQL query language. Some applications can use SQLite for
internal data storage. It’s also possible to prototype an application using SQLite and
then port the code to a larger database such as PostgreSQL or Oracle.
SQLite
Dhananjay(123059008)
import sqlite3
conn = sqlite3.connect('example.db')
c = conn.cursor()
c.execute('''CREATE TABLE stocks
(date text, trans text, symbol text, qty real,
price real)''')
c.execute("INSERT INTO stocks VALUES ('2006-0105','BUY','RHAT',100,35.14)")
conn.commit()
conn.close()
Above script is a simple demo of ‘how to connect to a Sqlute db using puthon’. Using
the library almost all database manipulations can be performed.
4. References
Referred during week 03 August 2013
Sqlite3 Resources: http://www.sqlite.org/
Sqlite browser: http://sourceforge.net/projects/sqlitebrowser/
Python Resources: http://docs.python.org/2/library/sqlite3.html