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 [2018/04/26 21:14] smayr [Create Database] |
swdev:sqlite:start [2018/07/18 14:07] (current) smayr [References] |
||
---|---|---|---|
Line 3: | Line 3: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | * [[https:// | ||
== Create Database == | == Create Database == | ||
- | Create a database schema using a file: < | + | Method 1: Create a database schema using a file: |
+ | < | ||
- | Or create | + | Method 2: Create |
<code bash> | <code bash> | ||
$ sqlite3 mydatabase.db | $ sqlite3 mydatabase.db | ||
Line 17: | Line 19: | ||
</ | </ | ||
- | Or create table interactively: | ||
<code bash> | <code bash> | ||
- | $ sqlite3 | + | $ sqlite3 |
- | sqlite> CREATE TABLE tbl2 ( | + | sqlite> CREATE TABLE product |
- | | + | |
- | | + | |
- | | + | |
+ | | ||
| | ||
sqlite> | 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:// |