Skip to content

Instantly share code, notes, and snippets.

@code-for-coffee
Created June 3, 2015 19:12
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 code-for-coffee/b8b7bfc22c2a109605e2 to your computer and use it in GitHub Desktop.
Save code-for-coffee/b8b7bfc22c2a109605e2 to your computer and use it in GitHub Desktop.
Draw a diagram that represents the following tables in a database
## Diagram a Database
- Owners HAVE MANY Pets
- Pets HAVE ONE Owner
- Pets and Owners have ONE Home
- Owners have:
- ID (int) as Primary Key
- Name (string)
- PetID (int) as Foreign Key
- HomeID (int) as Foreign Key
- Pets have:
- ID (int) as Primary Key
- Name (string)
- Breed (string)
- OwnerID (int) as Foreign Key
- HomeID (int) as Foreign Key
- Homes have:
- ID (int) as Primary Key
- Name (string)
- Insured (boolean)
- OwnerID (int) as Foreign Key
- PetID (int) as Foreign Key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment