~~~~~ Some commonly used SQL commands for SQLite ~~~~~~~~~~~
Create a database table:
Create Table if not exists
Table-Name (column-def1, column-def2)
Table-name: the name of the database table.
Column-Def: column definition of the table
Column-Def is further divided into: column-name type-name column-Constraint
Type-Name: Commonly Used integer/varchar
Column-constraint: commonly used forms include primary key
--------------------------------------------------------------------
Insert records into existing database tables:
Insert
Table-Name (column-name1, column-name2) values (expr1, expr2)
------------------------------------------------------------------------
Delete a record from an existing database:
Delete from
Squalified-table-name where expr
-------------------------------------------------------------------------
Delete A database table:
Drop table if exists table-name
Note: The drop TABLE statement removes a table added with the create table statement. the name specified is the table name. the dropped table is completely removed from the database schema and the disk file. the table can not be recovered. all indices and triggers associated with the table are also deleted.
------------------------------------------------------------------------------
Modify the record in the existing database table:
Update qualified-table-name set column-name = expr where expr
Note: The update statement is used to change the value of columns in selected rows of a table. each assignment in an update specifies a column name to the left of the equals sign and an arbitrary expression to the right. the expressions may use the values of other columns. all expressions are evaluated before any assignments are made. A Where clause can be used to restrict which rows are updated.
------------------------------------------------------------------------------
Select a qualified record from the existing table:
Select (distinct/all) from join-source where expr group-by ordering-term haing expr order by ordering-term