SQL statement Format
SQL instruction format: All SQL instructions are represented by a semicolon (;) end, and two minus signs (--) are the comments.
Such as:
Sqlite>create studen_table (\
Stu_no interger PRIMARY KEY, \
Name Text Not null,\
Id Interger UNIQUE, \
Age Interger CHECK (age>6), \
School text DEFAULT ' xx Primary school];
This statement creates a data table that records student information.
ANSI SQL statements are divided into the following six classes
(arranged by frequency of use):
Data Query Language (DQL): Its statements, also called "Data retrieval statements", are used to derive data from a table and determine how the data is given in the application. Reserved word select is the most used verb for dql (and all SQL), and the other dql commonly used reserved words are where,order by,group by and having. These dql reserved words are often used in conjunction with other types of SQL statements.
Data manipulation Language (DML): Its statements include verb insert,update and delete. They are used to add, modify, and delete rows in a table, respectively. Also known as the action query language.
Transaction language (TPL): Its statements ensure that all rows of the table affected by the DML statement are updated in a timely manner. The TPL statement includes begin TRANSACTION,COMMIT and rollback.
Data Control Language (DCL): Its statements are licensed through grant or revoke to determine access to database objects for individual users and groups of users. Some RDBMS can use grant or revoke to control access to individual columns of a table.
Data definition Language (DDL): Its statements create a new table (creat table) in the database, add indexes to the table, and so on. The DDL includes many reserved words related to the data obtained in the Human database directory. It is also part of the action query.
Pointer Control Language (CCL): Its statements, like declare cursor,fetch into and update WHERE current are used to manipulate one or more tables individually.
sqlite-sql-Statement format and classification