sqlite-sql-Statement format and classification

Source: Internet
Author: User
Tags sqlite

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.