Neocortex 🧠

Search

Search IconIcon to open search

Foreign Key Constraints

Last updated Dec 14, 2021 Edit Source

Sometimes, a relation between Entitys might need to me make a reference to another relation. In those cases, we use the following notation: Hero(id, first_name, last_name) Aliases(alias, heroid -> Hero(id)) in order to protect the referential integrity of the database, we set the constraint that a referencing attribute must be the key of a tuple that is in the database. When you have a composite key, the notation becomes: Hero(id, first_name, last_name) Aliases(alias, (hero_id, hero_name) -> Hero(id,first_name))


Interactive Graph