Top "Foreign-keys" questions

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

Foreign key constraints in Android using SQLite? on Delete cascade

I have two tables: tracks and waypoints, a track can have many waypoints, but a waypoint is assigned to only 1 …

java android sqlite foreign-keys
MySQL foreign key to allow NULL?

I'm piecing together an image website. The basic schema's pretty simple MySQL, but I'm having some trouble trying to represent …

mysql database null foreign-keys referential-integrity
SQL - Unique Key, Primary Key & Foreign Key

What are the differences between Unique Key, Primary Key and Foreign Key with respect to concept of SQL? How they …

sql foreign-keys primary-key rdbms unique-key
Basics of Foreign Keys in MySQL?

Is there any good explanation of how to use MySQL's foreign key construct? I don't quite get it from the …

mysql foreign-keys
Can I have a foreign key referencing a column in a view in SQL Server?

In SQL Server 2008 and given TableA(A_ID, A_Data) TableB(B_ID, B_Data) ViewC(A_or_B_ID, …

sql-server view foreign-keys
Join table twice - on two different columns of the same table

I have a very confusing database with a table that holds two values I need in a separate table. Here …

sql postgresql join foreign-keys left-join
Primary & Foreign Keys in pgAdmin

I was wondering can some give me an explanation on how to assign primary and foreign keys in pgAdmin? I …

postgresql foreign-keys primary-key pgadmin
MySQL: delete a row ignoring foreign key constraint

so I am working on a few tables and there are some data inconsistency between them... One or two tables …

mysql foreign-keys
Django model with 2 foreign keys from the same table

I wanted a Django model with 2 foreign keys from the same table. It's an event table which has 2 columns for …

django foreign-keys ambiguity
What is a proper naming convention for MySQL FKs?

Being that they must be unique, what should I name FK's in a MySQL DB?

mysql naming-conventions foreign-keys