-3

I have found the following E-R diagram in page 18 of Database System Concept book.

enter image description here

You will find more E-R diagram in that book. How can I draw similar design and colored E-R diagram?
If you want MWE you can see marmot's solution because I don't know how to do this before he answered.

[You can recommend better color combination]

alhelal
  • 2,451
  • Please add a minimal working example of what you have tried so far. This example could be useful: https://tex.stackexchange.com/questions/366486/crows-foot-erm-in-nice-way – CarLaTeX Mar 26 '18 at 05:40
  • @CarLaTeX As I don't know how to make this so I couldn't add MWE. Sorry. – alhelal Mar 26 '18 at 05:59
  • (i) first select package for drawing with which you are familiar; (ii) search through site for similar diagrams (here are plenty of them); (iii) if you like to have showed image, why you not include it your document by \includegraphics[...]{...}*? – Zarko Mar 26 '18 at 06:20
  • @Zarko I am familar with tikz-uml. I have done some class diagram using pgf-umlcd. I willn't include this image. I have to make new schema diagram and E-R diagram for my project. – alhelal Mar 26 '18 at 06:32
  • than i suggest you use pure tikz. for nodes use shape rectangle split from tikz library shapes.multipart. for start see http://www.texample.net/, maybe you will find something similar. to receive answer you should firs show, what you try so far. – Zarko Mar 26 '18 at 06:40

1 Answers1

2

All these diagrams are basic, and @Zarko already kindly told you the keywords you might want to look up if you are not already familiar with them. Even though the larger diagram can be straightforwardly be drawn, I am not in the mood to type in the text of your screen shot. So here comes a realization of the upper picture.

\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{positioning,shapes.multipart,shapes}
\begin{document}
\tikzset{basic/.style={
        draw,
        rectangle split,
        rectangle split parts=2,
        rectangle split part fill={blue!20,white},
        minimum width=2.5cm,
        text width=2cm,
        align=left,
        font=\itshape
    },
    Diamond/.style={ diamond, 
                        draw, 
                        shape aspect=2, 
                        inner sep = 2pt,
                        text centered,
                        fill=blue!10!white,
                        font=\itshape
                      }}
\begin{tikzpicture}
\node[basic] (instructor) {instructor
\nodepart{second}
\underline{ID}\\
name\\
salary};
\node[basic,right=5cm of instructor] (department) {department
\nodepart{second}
\underline{dept\_name}\\
building\\
budget};
\draw (instructor) -- (department) node[midway,Diamond]{member};
\end{tikzpicture}
\end{document}

enter image description here

  • ! Package PGF Math Error: Unknown functionitem' (in 'item.south').

    See the PGF Math package documentation for explanation. Type H for immediate help. ...

    l.49 email};

    ?` when I use this code. see my code https://paste.ubuntu.com/p/qv8yRVHFcR/ output https://pasteboard.co/HdROdKu.png

    – alhelal Mar 27 '18 at 17:20
  • The code runs through without a problem here. Note also that the code does neither contain item nor south. One possibility is that you are compiling a different code, another one is that there is something wrong with your TeX installation (perhaps it is outdated). –  Mar 27 '18 at 17:22
  • see my linked code. There also a node named item. And mainly I want to do something like https://tex.stackexchange.com/a/396436/128718 – alhelal Mar 27 '18 at 17:30
  • Your E-R diagram solution helps me lot. I am starting to make my works using your solution. But, I am stuck in schema diagram. If you would make the schema diagram only for instructor and department(you have already written, just need modification) then I use that syntax to start. Thank you. – alhelal Mar 27 '18 at 17:37
  • @alhelal OK, you were mixing two codes and got an error, right? If you cannot resolve it on your own, post the code as a question, and people will look at it. Then at least you have an MWE, and people won't downvote your question. (BTW, I did not downvote your questions.) –  Mar 27 '18 at 17:54
  • people are downvoting my question continuously. What can I do? – alhelal Mar 28 '18 at 00:14
  • @alhelal First of all, I did not downvote any of your questions, so I can only guess. One thing that I do not like is that you only provide screenshots for the new things that you wish others to do. Do you really believe anybody is keen to type in these things? You should really try to work on a solution on your own, type at least the texts you want and try to structure them. In the end, people here want to help you to learn how to do things on your own. –  Mar 28 '18 at 00:17