Top "Foreign-keys" questions

Foreign keys are a data integrity feature of relational (and SQL) databases.

Hibernate foreign key as part of primary key

I have to work with hibernate and not very sure how solve this problem, I've 2 table with a 1..n relationship …

hibernate foreign-keys composite-primary-key
Defining a Foreign key constraint in H2 Databases

I am new in coding so I made a tables in SQL server and it worked, so i used the …

sql database foreign-keys h2
MySQL terminology "constraints" vs "foreign keys" difference?

I'm looking at the MySQL docs here and trying to sort out the distinction between FOREIGN KEYs and CONSTRAINTs. I …

mysql foreign-keys constraints ddl
unable to drop the foreign key

I would like to drop the foreign key in my table but been into this error message mysql> alter …

mysql foreign-keys foreign-key-relationship mysql-error-1025
Problem adding Foreign Key using Alter Table with existing MYSQL Database - can't add it! Help!

I have a production database where I have renamed several column's that are foreign keys. Obviously mysql makes this a …

mysql foreign-keys alter-table mysql-error-1005 mysql-error-1025
Entity Framework DELETE statement conflicted with the REFERENCE constraint

I’m pretty new to EF and I have a little problem. I just want to delete an item in …

entity-framework foreign-keys cascade
Generate Delete Statement From Foreign Key Relationships in SQL 2008?

Is it possible via script/tool to generate a delete statement based on the tables fk relations. i.e. I …

sql code-generation foreign-keys dynamic-sql
MS SQL "ON DELETE CASCADE" multiple foreign keys pointing to the same table?

I have a problem where i need a cascade on multiple foreign keys pointing to the same table.. [Insights] | ID | …

sql sql-server foreign-keys constraints cascading-deletes
Foreign keys and NULL in mySQL

Can I have a column in my values table (value) referenced as a foreign key to knownValues table, and let …

mysql sql database-design foreign-keys database-relations
Enabling Foreign key constraints in SQLite

I'm using SQLite with C# and have some tables with foreign keys defined. Now, I know that by default foreign …

c# sql sqlite ado.net foreign-keys