From 39dcac2281970febcce36a0151796af2986388b3 Mon Sep 17 00:00:00 2001 From: Martin Michalec Date: Sat, 7 Nov 2026 09:12:48 +0300 Subject: publish --- doc/dbs.tex | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 doc/dbs.tex (limited to 'doc/dbs.tex') diff --git a/doc/dbs.tex b/doc/dbs.tex new file mode 100644 index 0000000..5436ffe --- /dev/null +++ b/doc/dbs.tex @@ -0,0 +1,115 @@ +\documentclass[tikz]{standalone} +\usepackage{fontspec} +\setmainfont{Liberation Serif} +\setsansfont{Liberation Sans} +\setmonofont{Iosevka Term Slab} + +\newcommand{\dumblang}[2]{{#1}} + +\begin{document} +\usetikzlibrary{er} +\usetikzlibrary{calc} +\usetikzlibrary{positioning} +\usetikzlibrary{shapes} +\usetikzlibrary{shapes.multipart} +\tikzset{ + my table/.style={ + draw, + minimum width=3.5cm, + %% inner sep=0.2cm, + execute at begin node=\strut, + anchor=north west, + font=\ttfamily, + rectangle split, + rectangle split allocate boxes=#1, + rectangle split parts=#1, + rectangle split part fill={blue!20,white}, + rectangle split part align={center, left}, + %% font=\itshape, + } +} + +\begin{tikzpicture} + \node[anchor=south east] at (19,0) {\dumblang{TOTAL}{ИТОГО}: 236592}; + + \node[my table=7] at (-1.5,-7) (students) { + \nodepart{one} 2 - \dumblang{students}{студенты} + \nodepart{two} \underline{\dumblang{id}{id}} + \nodepart{three} \dumblang{last\_name}{фамилия} + \nodepart{four} \dumblang{first\_name}{имя} + \nodepart{five} \dumblang{middle\_name}{отчество} + \nodepart{six} \dumblang{corporate\_email}{корпоративная\_почта} + \nodepart{seven} \dumblang{group\_id}{группа\_id} + }; \node[above=0.1cm of students.north west, anchor=south west] {6831}; + + + \node[my table=6] at (-1.5,0) (students-lab-assignments) { + \nodepart{one} 4 - \dumblang{students\_lab\_assignments}{студенты\_назначения\_лаб} + \nodepart{two} \underline{\dumblang{id}{id}} + \nodepart{three} \dumblang{student\_id}{студент\_id} + \nodepart{four} \dumblang{lab\_assignment\_id}{назначение\_лабы\_id} + \nodepart{five} \dumblang{date}{дата} + \nodepart{six} \dumblang{mark}{оценка} + }; \node[above=0.1cm of students-lab-assignments.north west, anchor=south west] {205032}; + + \node[my table=3] at (6,-2.66) (groups) { + \nodepart{one} 1 - \dumblang{groups}{группы} + \nodepart{two} \underline{\dumblang{id}{id}} + \nodepart{three} \dumblang{designator}{обозначение} + }; \node[above=0.1cm of groups.north west, anchor=south west] {300}; + + \node[my table=5] at (12,0) (lab-assignments) { + \nodepart{one} 3 - \dumblang{lab\_assignments}{назначения\_лаб} + \nodepart{two} \underline{\dumblang{id}{id}} + \nodepart{three} \dumblang{group\_id}{группа\_id} + \nodepart{four} \dumblang{lab\_id}{лаба\_id} + \nodepart{five} \dumblang{deadline}{срок} + }; \node[above=0.1cm of lab-assignments.north west, anchor=south west] {5993}; + + \node[my table=4] at (12,-4.2) (lab-assignments-teachers) { + \nodepart{one} 4 - \dumblang{lab\_assignments\_teachers}{назначения\_лаб\_преподаватели} + \nodepart{two} \underline{\dumblang{id}{id}} + \nodepart{three} \dumblang{lab\_assignment\_id}{назначение\_лабы\_id} + \nodepart{four} \dumblang{teacher\_id}{преподаватель\_id} + }; \node[above=0.1cm of lab-assignments-teachers.north west, anchor=south west] {17926}; + + \node[my table=4] at (6,-5.85) (labs) { + \nodepart{one} 2 - \dumblang{labs}{лабы} + \nodepart{two} \underline{\dumblang{id}{id}} + \nodepart{three} \dumblang{name}{название} + \nodepart{four} \dumblang{subject\_id}{предмет\_id} + }; \node[above=0.1cm of labs.north west, anchor=south west] {401}; + + \node[my table=3] at (6,-9.66) (subjects) { + \nodepart{one} 1 - \dumblang{subjects}{предметы} + \nodepart{two} \underline{\dumblang{id}{id}} + \nodepart{three} \dumblang{name}{название} + }; \node[above=0.1cm of subjects.north west, anchor=south west] {9}; + + \node[my table=6] at (12,-7.66) (teachers) { + \nodepart{one} 1 - \dumblang{teachers}{преподаватели} + \nodepart{two} \underline{\dumblang{id}{id}} + \nodepart{three} \dumblang{last\_name}{фамилия} + \nodepart{four} \dumblang{first\_name}{имя} + \nodepart{five} \dumblang{middle\_name}{отчество} + \nodepart{six} \dumblang{corporate\_email}{корпоративная\_почта} + }; \node[above=0.1cm of teachers.north west, anchor=south west] {100}; + + \draw (students.seven east) -| node[at start,above right] {$\infty$} node[below, at end, rotate=90] {$15-30$} ($(students.seven east)!.7!(groups.two west)$) |- node[at end,above left] {$1$} (groups.two west); + + \draw (students-lab-assignments.three west) -| node[at start,above left ] {$\infty$} node[below, at end, rotate=90] {$0-3$} ([xshift=-0.75cm]$(students-lab-assignments.three west)!.5!(students.two west)$) |- node[at end,above left] {$1$} (students.two west); + \draw (students-lab-assignments.four east) -| node[at start,above right] {$\infty$} ($(students-lab-assignments.four east)!.15!(lab-assignments.two west)$) |- node[at end,above left] {$1$} (lab-assignments.two west); + + \draw (labs.four east) -| node[at start,above right] {$\infty$} node[below, at end, rotate=90] {$30-100$} ([xshift=.75cm]$(labs.four east)!.5!(subjects.two east)$) |- node[at end,above right] {$1$} (subjects.two east); + + \draw (lab-assignments.three west) -| node[at start,above left] {$\infty$} node[below, at end, rotate=90] {$15-25$} ($(lab-assignments.three west)!.66!(groups.two east)$) |- node[at end,above right] {$1$} (groups.two east); + \draw (lab-assignments.four west) -| node[at start,above left] {$\infty$} ($(lab-assignments.four west)!.33!(labs.two east)$) |- node[at end,above right] {$1$} (labs.two east); + + \draw (lab-assignments-teachers.three east) -| node[at start,above right] {$\infty$} ([xshift=0.75cm]$(lab-assignments-teachers.three east)$) |- node[at end,above right] {$1$} (lab-assignments.two east); + \draw (lab-assignments-teachers.four east) -| node[at start,above right] {$\infty$} ([xshift=0.75cm]$(lab-assignments-teachers.four east)$) |- node[below, midway, anchor=north west, rotate=90] {$1-5$} node[at end,above right] {$1$} (teachers.two east); +\end{tikzpicture} +\end{document} + +%% Local Variables: +%% compile-command: "xelatex dbs.tex" +%% End: -- cgit v1.3.1