diff options
| author | 2026-11-07 06:12:48 +0000 | |
|---|---|---|
| committer | 2026-11-07 06:21:22 +0000 | |
| commit | 39dcac2281970febcce36a0151796af2986388b3 (patch) | |
| tree | 7339e54dc942a3ab0d9ba9daae56a2801c1917e9 /doc/erd.tex | |
| download | coursework-master.tar.gz | |
Diffstat (limited to 'doc/erd.tex')
| -rw-r--r-- | doc/erd.tex | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/doc/erd.tex b/doc/erd.tex new file mode 100644 index 0000000..1dcdb51 --- /dev/null +++ b/doc/erd.tex | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | \documentclass[tikz]{standalone} | ||
| 2 | \usepackage{fontspec} | ||
| 3 | \setmainfont{Liberation Serif} | ||
| 4 | \setsansfont{Liberation Sans} | ||
| 5 | |||
| 6 | \begin{document} | ||
| 7 | \usetikzlibrary{er} | ||
| 8 | \usetikzlibrary{calc} | ||
| 9 | \begin{tikzpicture} | ||
| 10 | [ | ||
| 11 | text depth=1pt, | ||
| 12 | every attribute/.style={fill=black!20,draw=black}, | ||
| 13 | every entity/.style={fill=blue!20,draw=blue,thick}, | ||
| 14 | every relationship/.style={fill=orange!20,draw=orange,thick,aspect=1.5} | ||
| 15 | ] | ||
| 16 | |||
| 17 | \node[entity] (student) at (6,3) {Студент} | ||
| 18 | child {node [attribute] at ($(student)+(-0.5,+1.5)$) {Корпоративная почта}} | ||
| 19 | child {node [attribute] at ($(student)+(+3.0,+1.5)$) {Имя}} | ||
| 20 | child {node [attribute] at ($(student)+(+3.0,+0.5)$) {Отчество}} | ||
| 21 | child {node [attribute] at ($(student)+(+3.0,-0.5)$) {Фамилия}}; | ||
| 22 | |||
| 23 | \node[entity] (teacher) at (0,-3) {Преподаватель} | ||
| 24 | child {node [attribute] at ($(teacher)+(-2.5,+1.5)$) {Фамилия}} | ||
| 25 | child {node [attribute] at ($(teacher)+(-2.5,+0.5)$) {Имя}} | ||
| 26 | child {node [attribute] at ($(teacher)+(-2.5,-0.5)$) {Отчество}} | ||
| 27 | child {node [attribute] at ($(teacher)+(-1.5,-1.5)$) {Корпоративная почта}}; | ||
| 28 | |||
| 29 | \node[entity] (group) at (0,3) {Группа} | ||
| 30 | child {node [attribute] at ($(group)+(0,1.5)$) {Обозначение}}; | ||
| 31 | |||
| 32 | \node[entity] (lab) at (6,0) {Лабораторная работа} | ||
| 33 | child {node [attribute] at ($(lab)+(3,0)$) {Название}}; | ||
| 34 | |||
| 35 | \node[entity] (subject) at (6,-3) {Предмет} | ||
| 36 | child {node [attribute] at ($(subject)+(0,-1.5)$){Название}}; | ||
| 37 | |||
| 38 | \node[relationship] (assigns) at (0,0) {Назначает} | ||
| 39 | child {node [attribute] at ($(assigns)+(-2.5,0)$){Срок}} | ||
| 40 | edge node[right] {N} (teacher) | ||
| 41 | edge node[above] {N} (lab) | ||
| 42 | edge node[right] {N} (group); | ||
| 43 | |||
| 44 | \node[relationship] at (6,-1.5) {По} | ||
| 45 | edge node[right] {N} (lab) | ||
| 46 | edge node[right] {1} (subject); | ||
| 47 | |||
| 48 | %% \node[relationship] (assigned) at (5,+1.5) {Назначена} | ||
| 49 | %% child {node [attribute] at ($(assigned)+(3,0)$){Срок}} | ||
| 50 | %% edge node[right] {N} (lab) | ||
| 51 | %% edge node[right] {N} (group); | ||
| 52 | |||
| 53 | \node[relationship] at (3,3) {Входит в} | ||
| 54 | edge node[above] {N} (student) | ||
| 55 | edge node[above] {1} (group); | ||
| 56 | |||
| 57 | \node[relationship] at (6,1.5) (attempted) {Сдавал} | ||
| 58 | child {node [attribute] at ($(attempted)+(-2,0)$){Дата}} | ||
| 59 | child {node [attribute] at ($(attempted)+(+2.5,0)$){Оценка}} | ||
| 60 | edge node[right] {N} (student) | ||
| 61 | edge node[right] {N} (lab); | ||
| 62 | \end{tikzpicture} | ||
| 63 | \end{document} | ||
| 64 | |||
| 65 | %% Local Variables: | ||
| 66 | %% compile-command: "xelatex erd.tex" | ||
| 67 | %% End: | ||
