Foreign key ingestion

A foreign key, in relational databases, is a field in one table that refers to the primary key of another table. A primary key is a column or combination of columns, to uniquely identify table records.

  • The table with the primary key is referred to as the referenced table or parent table.
  • The table with the foreign key is referred to as the child table.

Ingesting foreign keys

In Data Catalog, a foreign key is ingested as an asset of the Foreign key type. See Foreign Key asset page.
The Foreign key asset creates relations between columns of different tables. It consists of foreign key mappings between the parent and child table.
In the following example, you see an overview of the tables, columns and a foreign key:

  • food: Schema that consists of two tables:
    • food_types: Table with the columns food_name, food_code and food_type.
    • fastfood: Table with the columns main_food_code, company_name and main_food_type.
  • fastfood_fk: Foreign key asset consists of one or more foreign key mappings.
    • mapping 1 (marked with blue arrows):
      • Constrains the column main_food_code from the child table.
      • References the column food_code from the parent table.
    • mapping 2:
      • Constrains the column main_food_type from the child table.
      • References the column food_type from the parent table.