Entity-relationship Diagram Exercises And Answers Pdf -
\newpage
\newpage
\textbfTask: Draw the ERD showing: \beginitemize \item One-to-Many relationship between Department and Employee (works-in). \item One-to-One relationship between Employee and Department (manages). \item Indicate mandatory/optional participation. \enditemize
\sectionExercise 6: Supertype/Subtype (Generalization) \textbfScenario: \\ A vehicle rental system tracks vehicles. A vehicle can be either a Car or a Truck. \beginitemize \item All vehicles have: VIN (PK), make, model, year. \item Cars have: number of doors, fuel type. \item Trucks have: cargo capacity (tons), number of axles. \enditemize entity-relationship diagram exercises and answers pdf
\sectionExercise 2: Library System \textbfScenario: \\ A library wants to track books and members. \beginitemize \item \textbfBook: ISBN (unique), title, author, year. \item \textbfMember: member\_id (unique), name, phone. \item A member can borrow many books, but a specific copy of a book can be borrowed by only one member at a time (simplified: assume one copy per ISBN). \item A book may be borrowed by many members over time. \item The relationship \textbfBorrows has attributes: borrow\_date, return\_date. \enditemize
\textbfTask: Draw the ERD showing a weak entity (Line Item) and its identifying relationship.
\newpage
\newpage
\vspace2cm \noindent\rule\textwidth0.5pt \textbfAnswer: \beginfigure[H] \centering \begintikzpicture[node distance=2.5cm, auto] % Student Entity \node[rectangle, draw, minimum width=2.5cm, minimum height=1cm] (student) STUDENT; \node[above=0.2cm of student] \textbfStudent; \node[below=0.1cm of student, align=center] \tiny student\_ID (PK)\\ name\\ major;
\textbfTask: Draw the ERD. Identify primary keys, entity attributes, and relationship cardinality. \item Cars have: number of doors, fuel type
\section*Appendix: Quick ERD Notation Reference \begintcolorbox \begintabular \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
\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