I am have a problem with SQLITE3.
I have created 2 tables persons
and orders
using the following SQL script:
sqlite> create table Persons(
P_Id int primary key,
LastName varchar,
FirstName varchar,
Address varchar,
City varchar
);
sqlite> create table Orders(
O_Id int NOT NULL,
OrderNo int NOT NULL,
P_Id int,
PRIMARY KEY (O_Id),
FOREIGN KEY (P_Id) REFERENCES Persons(P_Id)
);
sqlite> insert into Orders values(1,77895,3);
sqlite> select * from Orders;
1|77895|3
sqlite>
Even though the persons table is empty rows can be inserted into the orders
table.
It does not show any error.
How is this possible.