Skip to main content
Engineering LibreTexts

1.18: Appendix B Sample ERD Exercises

  • Page ID
    6865
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Exercise 1

    Manufacturer

    A manufacturing company produces products. The following product information is stored: product name, product ID and quantity on hand. These products are made up of many components. Each component can be supplied by one or more suppliers. The following component information is kept: component ID, name, description, suppliers who supply them, and products in which they are used. Use Figure B.1 for this exercise.

    Create an ERD to show how you would track this information.

    Show entity names, primary keys, attributes for each entity, relationships between the entities and cardinality.

    Assumptions

    • A supplier can exist without providing components.
    • A component does not have to be associated with a supplier.
    • A component does not have to be associated with a product. Not all components are used in products.
    • A product cannot exist without components.

    ERD Answer

    Component(CompID, CompName, Description) PK=CompID

    Product(ProdID, ProdName, QtyOnHand) PK=ProdID

    Supplier(SuppID, SuppName) PK = SuppID

    CompSupp(CompID, SuppID) PK = CompID, SuppID

    Build(CompID, ProdID, QtyOfComp) PK= CompID, ProdID

    Ch-16-Component-Product-ERD-Answer-300x160

    Figure B.1 by A. Watt.

    Exercise 2

    Car Dealership

    Create an ERD for a car dealership. The dealership sells both new and used cars, and it operates a service facility (see Figure B.2). Base your design on the following business rules:

    • A salesperson may sell many cars, but each car is sold by only one salesperson.
    • A customer may buy many cars, but each car is bought by only one customer.
    • A salesperson writes a single invoice for each car he or she sells.
    • A customer gets an invoice for each car he or she buys.
    • A customer may come in just to have his or her car serviced; that is, a customer need not buy a car to be classified as a customer.
    • When a customer takes one or more cars in for repair or service, one service ticket is written for each car.
    • The car dealership maintains a service history for each of the cars serviced. The service records are referenced by the car’s serial number.
    • A car brought in for service can be worked on by many mechanics, and each mechanic may work on many cars.
    • A car that is serviced may or may not need parts (e.g., adjusting a carburetor or cleaning a fuel injector nozzle does not require providing new parts).

    ERD Answer

    carDealership


    This page titled 1.18: Appendix B Sample ERD Exercises is shared under a CC BY license and was authored, remixed, and/or curated by Adrienne Watt (BCCampus) .

    • Was this article helpful?