In regards to SQLite
, What is the difference between REFERENCES with, or without a FOREIGN KEY?
What is the difference between this
CREATE TABLE players_set (
_id INTEGER PRIMARY KEY AUTOINCREMENT
NOT NULL,
player_id INTEGER REFERENCES players ( _id ) ON DELETE CASCADE,
players_set_id INTEGER REFERENCES players_set_names ( _id )
);
and this:
CREATE TABLE players_set (
_id INTEGER PRIMARY KEY AUTOINCREMENT
NOT NULL,
player_id INTEGER,
players_set_id INTEGER REFERENCES players_set_names ( _id ),
FOREIGN KEY (player_id) REFERENCES players ( _id ) ON DELETE CASCADE
);
I found this other question: Difference between using REFERENCES with and without FOREIGN KEY?
I read the documentation, it didn't make it clear for me though.
To be precise, I'm using SQLite on Android
(hence the tag). I don't know if that makes any difference, but if it has its own quirks, it would be very useful for me to find out about.