Skip to content

Instantly share code, notes, and snippets.

@iguoli
Last active July 27, 2017 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iguoli/be04f1fd00482401867d24bfccbfc7b2 to your computer and use it in GitHub Desktop.
Save iguoli/be04f1fd00482401867d24bfccbfc7b2 to your computer and use it in GitHub Desktop.
Database Lesson

Database Design

Normalization

Function Dependency

The relationship (with in relation) that describes how the value of one atrribute may be used to find the value of another attribute.

Determinant

An attribute that can be used to find the value of another attribue in the relation.

Candidate key

  • The value of a candidate key can be used to find the value of every other non-key attribute in the talbe.
  • A simple candidate key consists of only one attribue.
  • A composite candidate key consists of more than one attribue.

Representing Relationships

1:1 Relationships

  • The key from one relation is placed in the other as a foreign key.
  • If both sides of the relationship are optional, it does not matter which table receives the foreign key.
  • If only one side of the relationship is optional, the optional side receives the foreignkey.

1:N Relationships

In a one to more relationship, the foreign key always goes into the many side of the relationship

  • The 1 side is called the parent
  • The N side is called the child
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment