# Database Entity Relationship Diagram

Is there a package that will allow me to create a database entity relationship diagram such as the one below?

• The question of "how to draw Database Entity-Relationship diagram" received an excellent answer there. It does not cover the particular case @sduplooy was looking at, but is much much extensive. – Clément Oct 2 '17 at 16:27

Run it with xelatexor latex=>dvips=>ps2pdf

\documentclass{article}
\usepackage{array,ragged2e,pst-node,pst-dbicons}
\newcolumntype{C}[1]{>{\Centering}p{#1}}
\def\Tab#1{\tabular{C{3cm}}\rule[-5mm]{0pt}{1cm}#1\\\hline
~\\\hline~\endtabular}
\begin{document}

\entity{students}[\Tab{Students}]\hspace{2.5cm}
\entity{courses}[\Tab{Courses}]
\ncline[arrowscale=2]{->}{students}{courses}
\naput[npos=0.1]{1}\naput{take}\naput[npos=0.85]{1..*}

\end{document}


You could use TikZ. Have a look at the TikZ diagram examples.

Another possibility is PSTricks.