Я вставил две строки в созданную таблицу, но она отображает одну строку в чем проблема?
create table Borrows(
bookid varchar(20) not null primary key,
bid varchar(50) not null,
check_out_date date not null,
returndate date not null,
foreign key (bookid) references Book(Bookid),
foreign key (bid) references Borrower(bid),
)
insert into Borrows values('ab100','cs01','2019-02-02','2019-02-12')
insert into Borrows values('ab101','cs02','2019-03-10','2019-03-13')
select * from borrows
out put
Msg 547, Level 16, State 0, Line 1
The INSERT statement conflicted with the FOREIGN KEY constraint "FK__Borrows__bid__3B75D760". The conflict occurred in database "databaselibrary", table "dbo.borrower", column 'bid'.
The statement has been terminated.
(1 row(s) affected)
What I have tried:
i tried to change datatypes of the entry elements