sqlite unique constraint code example
Example 1: sqlite make primary key
CREATE TABLE table_name(
column_1 INTEGER NOT NULL PRIMARY KEY,
...
);
CREATE TABLE table_name(
column_1 INTEGER NOT NULL,
column_2 INTEGER NOT NULL,
...
PRIMARY KEY(column_1,column_2,...)
);
Example 2: how to drop a unique constraint in sql
SHOW CREATE TABLE [tableName]
ALTER TABLE [tableName] DROP FOREIGN KEY constraintID
Example 3: sqlite unique
sqlite uniue
CREATE TABLE contacts(
contact_id INTEGER PRIMARY KEY,
first_name TEXT,
last_name TEXT,
email TEXT NOT NULL UNIQUE
);