\vspace2cm \noindent\rule\textwidth0.5pt \textbfAnswer: \beginfigure[H] \centering \begintikzpicture[node distance=2cm, auto] \node[rectangle, draw] (dept) DEPARTMENT \\ \tiny dept\_no (PK) \\ name \\ budget; \node[rectangle, draw, below=2cm of dept] (emp) EMPLOYEE \\ \tiny emp\_ID (PK) \\ name \\ salary;

\vspace2cm \noindent\rule\textwidth0.5pt \textbfAnswer: \beginfigure[H] \centering \begintikzpicture[node distance=2.5cm] \node[rectangle, draw] (member) MEMBER \\ \tiny member\_ID (PK) \\ name \\ phone; \node[rectangle, draw, right=3cm of member] (book) BOOK \\ \tiny ISBN (PK) \\ title \\ author \\ year; \node[diamond, draw, aspect=2, below=1.5cm of $(member.south)!0.5!(book.south)$] (borrows) BORROWS; \node[below=0.2cm of borrows] \tiny borrow\_date, return\_date;

\newpage

\newpage

% Relationship \node[diamond, draw, aspect=2, minimum width=2cm, minimum height=1cm, below=1.2cm of $(student.south)!0.5!(course.south)$] (enroll) ENROLLS; \node[below=0.2cm of enroll, align=center] \tiny enrollment\_date;

% Lines \draw (student) -- (enroll) node[midway, left] M; \draw (course) -- (enroll) node[midway, right] M;

\newpage

% Optional: show as associative entity? For clarity, many-to-many with attribute. \endtikzpicture \captionERD for University Enrollment (Many-to-Many with attribute) \endfigure \noindent\textitNote: In physical design, ENROLLS becomes a bridge table containing student\_ID, course\_code, and enrollment\_date.

\textbfNotation: We use \textbfCrow's Foot notation. \beginitemize \item Entities: Rectangles \item Primary Key: Underlined attribute \item Relationships: Diamonds (or labeled lines) with crow's foot for many side. \item Cardinalities: 1 (one), M (many), (0,1) optional one, etc. \enditemize

% Works-in (1 to many) \draw (dept) -- node[right] 1 ++(2,0) -- node[above] works-in ++(0,-1.5) -- node[left] M (emp); % Manages (1 to 1, but optional on employee side because not every employee is a manager) \draw[->, thick] (emp.east) -- ++(1.5,0) -- ++(0,1.5) -- node[above, midway] manages (1) (dept.east); \node at (3.5,-0.2) 1 (optional);

\vspace2cm \noindent\rule\textwidth0.5pt \textbfAnswer: \beginfigure[H] \centering \begintikzpicture \node[rectangle, draw] (vehicle) VEHICLE \\ \tiny VIN (PK) \\ make \\ model \\ year; \node[rectangle, draw, below left=1.5cm and 1cm of vehicle] (car) CAR \\ \tiny doors \\ fuel\_type; \node[rectangle, draw, below right=1.5cm and 1cm of vehicle] (truck) TRUCK \\ \tiny cargo\_capacity \\ axles; \draw (vehicle) -- (car) node[midway, left] ISA (d); \draw (vehicle) -- (truck) node[midway, right] ISA (d); \endtikzpicture \captionGeneralization: Vehicle supertype with Car and Truck subtypes \endfigure

\section*Appendix: Quick ERD Notation Reference \begintcolorbox \begintabularl \hline \textbfSymbol & \textbfMeaning \\ \hline Rectangle & Entity \\ Oval & Attribute (sometimes omitted, listed inside entity) \\ Diamond & Relationship \\ Underline & Primary Key \\ Double Rectangle & Weak Entity \\ Double Diamond & Identifying Relationship \\ 1 at line end & One cardinality \\ M or * at line end & Many cardinality \\ Circle (O) & Optional participation \\ \hline \endtabular \endtcolorbox

WordPress Video Lightbox Plugin