Are there any differences between
CREATE TABLE HIS (AA PRIMARY KEY, BB, CC);
CREATE TABLE HIS (AA, BB, CC);
CREATE UNIQUE INDEX HIS_INDEX0 ON HIS (AA);
In most cases, UNIQUE and PRIMARY KEY constraints are implemented by creating a unique index in the database. (The exceptions are INTEGER PRIMARY KEY and PRIMARY KEYs on WITHOUT ROWID tables.) Hence, the following schemas are logically equivalent:
CREATE TABLE t1(a, b UNIQUE);
CREATE TABLE t1(a, b PRIMARY KEY);
CREATE TABLE t1(a, b);
CREATE UNIQUE INDEX t1b ON t1(b);
http://www.sqlite.org/lang_createtable.html (scroll down to: SQL Data Constraints)
Thanks. Now I feel safer.
Why not always use create index?
It has the ability to be dropped.
No pirmary key specification with create index or autoincrement
Not easily dropped without rebuilding table.
These are considerations and not an answer to this quesition.