答案1
所有这些图表都是基本的,@Zarko 已经很贴心地告诉了你可能需要查找的关键字(如果你还不熟悉的话)。尽管可以直接绘制更大的图表,但我没有心情输入屏幕截图中的文字。所以这里是上图的实现。
\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}