SQLite Statement Summary

Source: Internet
Author: User
Tags sqlite

First, create the database:

1, click Connection, choose SQLite

2. Enter "Connection name" and "Choose Path to save Database"

3, after selecting the path, double-click "Connection Name", come out Main ()

4. Right-click Main, select New Query ..., (opens a new window)

5. Sq statement:

PS: First understand a few noun concepts:

A, table name: t_people (format t_ name). A table corresponds to a table name. There can be many tables in a database.

b, keywords.

C, field. A table can have many fields, and a field is a column. But there is only one field that is a primary key. A primary key is used to uniquely identify a record. (ROW)

The primary key is typically represented by an ID. and is of type Integer, to set AutoIncrement, let the primary key increment.

The fields of the SQLite itself are of no type. But for convenience, to improve readability, you typically add a type to a field. Common types:

Text: literal type, string.  Integer: integer type. REAL: Floating-point type. BLOB: binary, such as file.

5.1 Creating a Table

/* If the table does not exist, create a table. Enter the following command, run, the refresh will come out */

/*
CREATE TABLE IF not EXISTS t_people (ID integer PRIMARY KEY, name TEXT, age INTEGER, height TEAL);
CREATE TABLE IF not EXISTS t_people (ID integer PRIMARY KEY autoincrement, name TEXT, age INTEGER, height TEAL);
*/

5.2 Deleting a table

/* Delete a table */
/*
DROP TABLE IF EXISTS t_people;
*/

SQLite Statement Summary

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.