diff --git a/.obsidian/workspace b/.obsidian/workspace index f505214..3ef85b5 100644 --- a/.obsidian/workspace +++ b/.obsidian/workspace @@ -9,7 +9,7 @@ "state": { "type": "markdown", "state": { - "file": "School/Development/Primary Key.md", + "file": "School/Development/Foreign Key.md", "mode": "source" } } @@ -68,7 +68,7 @@ "state": { "type": "backlink", "state": { - "file": "School/Development/Primary Key.md", + "file": "School/Development/Foreign Key.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -87,8 +87,8 @@ }, "active": "bc6e8ad9aa0f44c3", "lastOpenFiles": [ - "School/Development/Primary Key.md", "School/Development/Foreign Key.md", + "School/Development/Primary Key.md", "School/Development/SQL Database.md", "School/Analyse/OSI Model.md", "School/Analyse/Images/OSI-model.png", diff --git a/School/Development/Foreign Key.md b/School/Development/Foreign Key.md index 732f38b..12bb562 100644 --- a/School/Development/Foreign Key.md +++ b/School/Development/Foreign Key.md @@ -1,6 +1,8 @@ # Foreign Key A Foreign key is a [[Constraint]] that protects links between tables. Foreign key is a attribute or attributes that link to the [[Primary Key]] of a other entity set (table). -For - +## Example +|ID (PK)|Name|Age|Sex|Length| +|-----|-----|-----|-----|-----| +|1|Nick|21|M|190| \ No newline at end of file diff --git a/School/Development/Primary Key.md b/School/Development/Primary Key.md index 1b696eb..384b28d 100644 --- a/School/Development/Primary Key.md +++ b/School/Development/Primary Key.md @@ -5,4 +5,8 @@ There can only be ONE primary per table and can consist of multiple attributes ( A primary key is **not** required, but highly advised. Even if you don't use it its better to include one in your schema. -## Exaple +## Example + +**Name (PK) - Age - Sex - Length** + +In the table schema above, only one entity where the name is Nick can exist because Name is the primary key.