Entity-relationship Diagram Exercises And Answers Pdf -

\newpage

% 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); entity-relationship diagram exercises and answers pdf

\newpage

\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 \newpage % Works-in (1 to many) \draw (dept)

\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 \item Cars have: number of doors, fuel type

\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

\newpage