sqlite filename.db |
Will create a new database
|
CREATE TABLE name ( colname type constraints, colname type constraints)INSERT INTO tablename (column2, column4)VALUES(data1, data2),(data3, data4);UPDATE tablenameSET column5 = value5WHERE expressionALTER TABLE function is limited in SQLite.ALTER TABLE tablename RENAME TO newtablenameALTER TABLE tablename ADD COLUMN columndefintionDROP TABLE tablenameSELECT table1.column1, table.2column2,FROM table1, table2WHERE expressionORDER BY table1.column1 orderORDER BY is optional, possible ways to order are ASC (ascending) and DESC (descending).
NULL |
null value
|
INTEGER |
Integer value
|
REAL |
8-byte floating point number
|
TEXT |
Text with UTF encoding
|
BLOB |
Blob-Data (stored like input)
|
BOOLEAN |
Will be stored as Integer (0 for false, 1 for true)
|
PRIMARY KEY |
Sets column as primary key. The constraints
NOT NULL and UNIQUE will be set automatically. |
NOT NULL |
Prevents the column from empty values (
null). |
UNIQUE |
Each value in the column has to be unique.
|
INTEGER PRIMARY KEYs will automatically become the ROWID and therefore will be automatically incremented. This column can be accessed as ROWID, OID, _ROWID_ or the column name.
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.