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