Skip to content

Instantly share code, notes, and snippets.

@xieyuheng
Created July 9, 2019 14:55
Show Gist options
  • Save xieyuheng/1b80b64a9713ef69b63d7805d623efa3 to your computer and use it in GitHub Desktop.
Save xieyuheng/1b80b64a9713ef69b63d7805d623efa3 to your computer and use it in GitHub Desktop.
Employee: {
name: String
birthDate: Date
children: Table {
name: String
birthDate: Date
}
jobHistory: Table {
jobTitle: String
salaryHistory: Table {
data: Date
salary: Salary
}
}
}
// normalization =>
Employee: {
PK employeeId: Id
name: String
birthDate: Date
}
Children: {
PK childrenId: Id
FK employeeId: Id
name: String
birthDate: Date
}
JobHistory: {
PK jobHistoryId: Id
FK employeeId: Id
jobTitle: String
}
SalaryHistory: {
PK salaryHistoryId: Id
FK jobHistoryId: Id
data: Date
salary: Salary
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment