Hi bro, I am following your whole SQL series and I have learnt all the concepts but this ON DELETE concept sucks. I typed the same query as you have shown but still it gives me error "Error Code: 1451. Cannot delete or update a parent row: a foreign key constraint fails (`mydb`.`transactions`, CONSTRAINT `transactions_ibfk_1` FOREIGN KEY (`c_id`) REFERENCES `customers` (`c_id`))". Can you please help me with this @BroCode .
The query in my MYSQL WorkBench -> alter table transactions1 drop foreign key transactions1_ibfk_1; alter table transactions1 add constraint transactions1_ibfk_1 foreign key transactions1 (customer_id) references customers(c_id) ON DELETE cascade;
Just because you can't do (despite spoon feeding) doesn't mean his video Sucks! He explained in the best and easiest manner, but the issue is with you that you can't manage a minor error which clearly states the issue which you don't want to read. Dumb***
ALTER TABLE transactions
ADD CONSTRAINT fk_customer_id
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
ON DELETE SET NULL;
ALTER TABLE transactions
ADD CONSTRAINT fk_customer_id
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
ON DELETE CASCADE;
thanks for literally existing
I love how you explain things in the simplest way.
Perfectly understandable.
Many thanks man.
Bro you made everything so easy peasy to understand. Love you
Good Explanation thanks
so clear for anyone, super cool
This is a really useful tutorial
THX
thank you for you incredible work bro i luv u
I cant thank you enough
question, if the data that has the foreign key is not nullable, does the on delete set null still work?
Hey Bro, could you please create java spring boot tutorial.
ty for python tutorial
Thx bro
Hi bro, I am following your whole SQL series and I have learnt all the concepts but this ON DELETE concept sucks. I typed the same query as you have shown but still it gives me error "Error Code: 1451. Cannot delete or update a parent row: a foreign key constraint fails (`mydb`.`transactions`, CONSTRAINT `transactions_ibfk_1` FOREIGN KEY (`c_id`) REFERENCES `customers` (`c_id`))". Can you please help me with this @BroCode .
The query in my MYSQL WorkBench -> alter table transactions1
drop foreign key transactions1_ibfk_1;
alter table transactions1
add constraint transactions1_ibfk_1
foreign key transactions1 (customer_id) references customers(c_id)
ON DELETE cascade;
Just because you can't do (despite spoon feeding) doesn't mean his video Sucks! He explained in the best and easiest manner, but the issue is with you that you can't manage a minor error which clearly states the issue which you don't want to read. Dumb***
set foreign_key_checks = 0; temporarly and then set it back to 1
@@kin_1997 Thanks for the solution mate, but I think now I am not gonna solve a 1 year old query 🥲
@@_sumedh_music haha no problem, maybe someone else will see solution and it will help them
could you please do full PHP course bro?
i dont know bro what is your obsession with poppy puff