How to overwrite Database on MySQL Foreign key

I created a simple 2 tables to experiment foreign keys, but when I input values into the Foreign table it does not overwrite current columns.

create table testing2 (balance bigint, stud int, FOREIGN KEY (stud) REFERENCES testing(stud)); insert into testing2 values ('4000','0','1'); insert into testing2 values ('4000','2000','1'); 

The result would show all the values inserted, I want to overwrite it on my last insert

Add Comment
1 Answer(s)

To overwrite values just use UPDATE instead of INSERT.
Also, why are you trying to insert 3 values in a table with 2 columns?

Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.