1. LPU MCA Semester 1
  2. CAP570
  3. Unit 2

CAP570 · Unit 2: E-R modeling

ER modelling basics: entities, attributes, relationships and ER diagram notations

10 practice questions · in the MTE and ETE syllabus

Key points

  • Rectangles are entities, ellipses are attributes, diamonds are relationships
  • Multivalued attributes use a double ellipse
  • Weak entities are identified through an owner
  • Total participation is drawn as a double line

An entity is a thing about which data is kept, and an entity set is a collection of similar entities. A relationship associates entities. Attributes describe them.

Chen notation: entity set = rectangle, weak entity = double rectangle, attribute = ellipse, key attribute = underlined, multivalued attribute = double ellipse, derived attribute = dashed ellipse, relationship = diamond, identifying relationship = double diamond.

Attribute kinds: simple, composite (splits into parts such as FirstName and LastName), multivalued (several values, such as phone numbers), derived (computed, such as Age from DateOfBirth).

Cardinality of a relationship is 1:1, 1:N or M:N. Participation is total (every entity takes part, double line) or partial. A weak entity lacks a full key of its own and is identified by an owner entity plus a partial key. Relationships can carry attributes, such as Quantity on an order-product relationship.

Exam trap: direction matters when naming cardinality, so read it from the first entity set to the second.

Try two questions

Question 1 · Tier 2, Understand

Age is calculated from the stored attribute DateOfBirth. In an ER model, Age is which kind of attribute?

  1. Composite attribute
  2. Multivalued attribute
  3. Weak attribute
  4. Derived attribute
Show the answer

D. Derived attributes are computed from other attributes and are drawn with dashed ellipses.

Why not A: Age has no sub-parts; it is computed from another attribute.

Why not B: A person has only one age at a time.

Why not C: There is no such standard attribute type in ER modelling.

Question 2 · Tier 3, Apply

A student can have several phone numbers. How should PhoneNumber be modelled in the ER diagram?

  1. As a multivalued attribute drawn with a double ellipse
  2. As a derived attribute drawn with a dashed ellipse shape
  3. As a weak entity drawn with a double rectangle
  4. As a key attribute drawn with an underlined ellipse
Show the answer

A. An attribute that can hold several values for one entity is multivalued and has a double ellipse.

Why not B: Phone numbers are not computed from other attributes.

Why not C: A phone number alone does not require its own owner-dependent entity.

Why not D: A key identifies a student; a student has several phone numbers.