Skip to content

Instantly share code, notes, and snippets.

@pykello
Created August 4, 2019 05:23
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 pykello/639746c78498135f0fc1a9947cb92fe0 to your computer and use it in GitHub Desktop.
Save pykello/639746c78498135f0fc1a9947cb92fe0 to your computer and use it in GitHub Desktop.
#lang racket
(require graphviz)
(define tables
`(("product" ("title"
"description"
"price"))
("category" ("title"
"description"))
("customer" ("firstname"
"lastname"
"address"))
("order" ("customer"
"status"
"shipping-method"
"comments"))
("lineitem" ("order"
"product"
"price"
"discount"))
("supplier" ("name"))))
(define relations
`(("product" "category" 'many 'many)
("order" "lineitem" 'one 'many)
("lineitem" "product" 'many 'one)
("order" "customer" 'many 'one)
("supplier" "order" 'one 'many)
("lineitem" "supplier" 'many 'one)))
(er-diagram tables relations)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment