I recently started using SQLite (as required for my research), and I came up with a few SQLite limitations, and I was wondering: is it possible for SQLite to create foreign keys in a single table? For example. this is my code:
CREATE TABLE Categories
(
name varchar(20),
parent_category varchar(20) NULL,
PRIMARY KEY(name),
FOREIGN KEY parent_category_fk(parent_category) REFERENCES Categories(name)
)
But this gives me an error for a foreign key when I try to execute SQL in SQLiteStudio.
Does anyone know why this is not working?
source
share