Http://www.runoob.com/sqlite/sqlite-create-table.html
SqliteCreate a table
The SQLite Create table statement is used for creating a new table in any given database. Create a basic table that involves naming tables, defining columns, and data types for each column.
Grammar
The basic syntax for the CREATE TABLE statement is as follows:
CREATE TABLE database_name.table_name ( column1 datatype PRIMARY KEY (one or more columns), column2 datatype , column3 datatype, ... .. COLUMNN datatype,);
A CREATE table is a keyword that tells the database system to create a new table. The CREATE table statement is followed by the unique name or identity of the table. You can also choose to specify a database_namewith table_name .
Instance
The following is an instance that creates a company table with an ID as the primary key, and a constraint of NOT NULL indicates that the fields cannot be null when records are created in the table:
Sqlite> CREATE TABLE Company ( ID INT PRIMARY KEY isn't null, NAME TEXT not null, age int< C7/>not NULL, ADDRESS CHAR (+), SALARY REAL);
Let's create another table, which we'll use in the exercises in the subsequent chapters:
Sqlite> CREATE TABLE DEPARTMENT ( ID INT PRIMARY KEY not null, DEPT CHAR (a) not NULL, EMP_ ID INT not NULL);
You can use the . Tables command in the SQLIte command to verify that the table was created successfully, which lists all the tables in the attached database.
Sqlite>.tablescompany DEPARTMENT
Here, you can see that the company table appears two times, one is the company table of the main database, and one is the Test.company table for the ' test ' alias created for Testdb.db. You can use the SQLite . Schema command to get the complete information for the table, as follows:
Sqlite>.schema companycreate TABLE Company ( ID INT PRIMARY KEY is not null, NAME TEXT is not null, Age INT not NULL, ADDRESS CHAR (+), SALARY REAL);
SQLite using tutorial 6 to create a table