Do I need a foreign key?

I read that the foreign key is needed at the database level, and the relations at the application level. That's the question. When designing, is it necessary to write a foreign key, or is it enough that at the application level?
1 Reply
francis
francis11mo ago
I'd say you want a foreign key I assume you want referential integrity like not being able to point a record off to a record that doesn't exist, or to delete a record that has stuff pointing to it without having those references either throw an error or get removed
Want results from more Discord servers?
Add your server