Why is Sqlite allowing me to insert a foreign key in table2 that does not match with any primary keys in table1? I am using .NET and System.Data.SQLite.dll
Here is my setup:
create table [table1] (
[Id] integer primary key NOT NULL
, [col1] nvarchar(100) NULL
);
create table [table2] (
[Id] integer primary key NOT NULL
, [col2] integer NOT NULL
, FOREIGN KEY(col2) REFERENCES table1(Id)
);
INSERT INTO [table1] ([col1]) VALUES ('val1');
INSERT INTO [table2] ([col2]) VALUES ('2');
SQL fiddle: http://sqlfiddle.com/#!7/4fccc/1/0