24 March 2016

Tutorial SQLite Create Database

sqlite

Introduction

Tutorial SQLite Create Database. SQLite is a relational database management system that is ACID-compliant and has a size relatively small code library, written in C. 

What is SQLite?

SQLite is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. It is the one database, which is zero-configured, that means like other database you do not need to configure it in your system.

SQLite engine is not a standalone process like other databases, you can link it statically or dynamically as per your requirement with your application. The SQLite accesses its storage files directly.

Why SQLite?


  • SQLite does not require a separate server process or system to operate.(serverless).
  • SQLite comes with zero-configuration, which means no setup or administration needed.
  • A complete SQLite database is stored in a single cross-platform disk file.
  • SQLite is very small and light weight, less than 400KiB fully configured or less than 250KiB with optional features omitted.
  • SQLite is self-contained, which means no external dependencies.
  • SQLite transactions are fully ACID-compliant, allowing safe access from multiple processes or threads.
  • SQLite supports most of the query language features found in the SQL92 (SQL2) standard.
  • SQLite is written in ANSI-C and provides simple and easy-to-use API.
  • SQLite is available on UNIX (Linux, Mac OS-X, Android, iOS) and Windows (Win32, WinCE, WinRT).

Download SQLite
In this tutorial in windows.
sqlite windows download
Download two file in here.
Use your command prompt line to access your sqlite.exe. 
For a listing of the available dot commands, you can enter ".help" at any time. For example:
sqlite>.help

CommandDescription
.backup ?DB? FILEBackup DB (default "main") to FILE
.bail ON|OFFStop after hitting an error. Default OFF
.databasesList names and files of attached databases
.dump ?TABLE?Dump the database in an SQL text format. If TABLE specified, only dump tables matching LIKE pattern TABLE.
.echo ON|OFFTurn command echo on or off
.exitExit SQLite prompt
.explain ON|OFFTurn output mode suitable for EXPLAIN on or off. With no args, it turns EXPLAIN on.
.header(s) ON|OFFTurn display of headers on or off
.helpShow this message
.import FILE TABLEImport data from FILE into TABLE
.indices ?TABLE?Show names of all indices. If TABLE specified, only show indices for tables matching LIKE pattern TABLE.
.load FILE ?ENTRY?Load an extension library
.log FILE|offTurn logging on or off. FILE can be stderr/stdout
.mode MODESet output mode where MODE is one of:
  • csv Comma-separated values
  • column Left-aligned columns.
  • html HTML <table> code
  • insert SQL insert statements for TABLE
  • line One value per line
  • list Values delimited by .separator string
  • tabs Tab-separated values
  • tcl TCL list elements
.nullvalue STRINGPrint STRING in place of NULL values
.output FILENAMESend output to FILENAME
.output stdoutSend output to the screen
.print STRING...Print literal STRING
.prompt MAIN CONTINUEReplace the standard prompts
.quitExit SQLite prompt
.read FILENAMEExecute SQL in FILENAME
.schema ?TABLE?Show the CREATE statements. If TABLE specified, only show tables matching LIKE pattern TABLE.
.separator STRINGChange separator used by output mode and .import
.showShow the current values for various settings
.stats ON|OFFTurn stats on or off
.tables ?PATTERN?List names of tables matching a LIKE pattern
.timeout MSTry opening locked tables for MS milliseconds
.width NUM NUMSet column widths for "column" mode
.timer ON|OFFTurn the CPU timer measurement on or off

SQLite Create Database

The SQLite sqlite3 command is used to create new SQLite database. You do not need to have any special privilege to create a database.

Syntax:
Basic syntax of sqlite3 command is as follows:
$sqlite3 DatabaseName.db
Always, database name should be unique within the RDBMS.

Advantages

  • SQLite uses operating read / write without any intermediary server process tesendiri, of course, will make the performance offered by SQLite to be much better when compared with other databases.
  • Has a serverless properties and zero configuration, it will be easier for developers to migrate from one environment to another environment. Enough with the copy and paste files and database applications is required then we will be migrated easily.
source : 
http://www.tutorialspoint.com/sqlite
https://id.wikipedia.org/wiki/SQLite

No comments: