Data storage--sqlite Database storage

Source: Internet
Author: User
Tags sqlite sqlite database

I. Features

1. Storage of data with a certain structure

2. File type. db

Two. SQLite database

1. Features

1-Lightweight relational database

2-Supports multiple programming languages

3-Suitable for use on mobile devices

4-Small installation files

5-Supports multiple operating systems

6-Fast running speed (low data volume)

7-The database itself is a single file

2. Data type

1-integers: INT, integer;

2-floating point: float, DOUBLE;

3-string literal

①char, fixed-length string;

②warchar, variable-length string;

③text, large text;

4-Time: Date, DateTime;

5-File: BLOB, infrequently used, affects query efficiency.

3. Table

N-Table name

2-field

① field name, with English letters and numbers, underline combination;

② Data types

③ data length: Floating-point number, total length or length after decimal point;

④ Default Value

3-Constraints

① non-null constraint: The field contents cannot be null;

② PRIMARY KEY constraints

1> Features

⑴ field content is not empty

⑵ primary key field content (Multi-field content merge) Unique, cannot have duplicate rows

⑶ A table can have only one primary key, but may have more than one primary key field

⑷ commonly used for data retrieval positioning and sorting

2> selection Form

⑴ Unique code information for table data

⑵_id

? auto-Grow field or sequence (self-growing number)

? data type is integral type

? The default is automatically incremented from 1, plus 1 for each fetch

⑶ a string of letters and numbers that uniquely identifies the guid:32 bit globally.

The process of the table:

Data storage--sqlite Database storage

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.