Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
swdev:sqlite:start [2017/10/17 08:54] smayr |
swdev:sqlite:start [2018/07/18 14:07] (current) smayr [References] |
||
---|---|---|---|
Line 1: | Line 1: | ||
= SQLite = | = SQLite = | ||
+ | == Download == | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | |||
== Create Database == | == Create Database == | ||
- | Create a database schema using a file: < | + | Method 1: Create a database schema using a file: |
+ | < | ||
+ | |||
+ | Method 2: Create schema manually (and then enter SQL commands at the prompt to create and populate the new tables): | ||
+ | <code bash> | ||
+ | $ sqlite3 mydatabase.db | ||
+ | sqlite> create table greetings(one varchar(10), | ||
+ | sqlite> insert into greetings values(' | ||
+ | sqlite> insert into greetings values(' | ||
+ | sqlite> select * from greeting; | ||
+ | </ | ||
+ | |||
+ | <code bash> | ||
+ | $ sqlite3 mydatabase.db | ||
+ | sqlite> CREATE TABLE product ( | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | sqlite> | ||
+ | </ | ||
+ | |||
+ | Method 3: Create table by importing CSV file: | ||
+ | <code bash> | ||
+ | $ sqlite3 mydatabase.db | ||
+ | sqlite> .mode csv | ||
+ | sqlite> .import C:/ | ||
+ | </ | ||
+ | |||
+ | == Alter Table == | ||
+ | <code bash> | ||
+ | ALTER TABLE table_name | ||
+ | ADD new_column_name column_definition; | ||
+ | </ | ||
+ | |||
+ | == SQLite Client == | ||
+ | * [[swdev: | ||
== References == | == References == | ||
* CLI: [[http:// | * CLI: [[http:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// |