Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- digraph ERDiagram {
- // This is the ER-diagram for a personal library management app project. It'll end up on github one day!
- rankdir=BT;
- // The different entities in our data set.
- books [shape=box, color=blue];
- user [shape=box, color=red];
- acquaintance [shape=box, color=red];
- // The different attributes in our data set.
- metadata [shape=oval, color=blue];
- "config data" [shape=oval, color=red];
- // The different relationships we have;
- owns [shape=diamond, color=blue];
- wants [shape=diamond, color=blue];
- lends [shape=diamond, color=red];
- borrows [shape=diamond, color=red];
- "exchanges\nwith" [shape=diamond, color=red];
- // The main component in our case is, ofc, books. So here they are!
- metadata -> books;
- // Things can happen to books.
- owns -> books ;
- wants -> books;
- lends -> books;
- borrows -> books;
- // We also have user of our app. He's the chief librarian in a sense.
- // He has a password, a username, etc...
- "config data" -> user;
- // He interacts with his books...
- user -> owns; // Our user owns books.
- user -> wants; // Or sometimes wants them in a wishlist.
- // ...and with other people.
- user -> "exchanges\nwith"; // He also knows other people that read books.
- user -> lends;
- // And so we have the aforementioned other people.
- // They also interact with books, but we don't care about their books, only ours.
- acquaintance -> borrows;
- // But they mostly interact with user.
- acquaintance -> "exchanges\nwith";
- {rank=max; metadata}
- }
Add Comment
Please, Sign In to add comment