CREATE TABLE [IF NOT EXISTS] [schema_name].table_name (
column_1 data_type PRIMARY KEY,
column_2 data_type NOT NULL,
column_3 data_type DEFAULT 0,
table_constraints
) [WITHOUT ROWID];
// To create tables in SQLite
CREATE TABLE "invoice"
(
id INTEGER PRIMARY KEY,
shipping_address TEXT NOT NULL,
total_cost INTEGER NOT NULL
);
CREATE TABLE "order"
(
id INTEGER PRIMARY KEY,
invoice_id INTEGER NOT NULL,
product_name TEXT NOT NULL,
FOREIGN KEY (invoice_id) REFERENCES invoice (id)
);
db.run('CREATE IF NOT EXISTS TABLE users(name TEXT NOT NULL)');
cmd.CommandText = @"CREATE TABLE cars(id INTEGER PRIMARY KEY,
name TEXT, price INT)";
cmd.ExecuteNonQuery();