GATE CS - DATABASES (DBMS):ER and Relational Model

Mastering er and relational model concepts and implementation.

ER and Relational Model for GATE CS

GATE tests keys, ER-to-relational mapping, and integrity constraints more than drawing pretty ER diagrams. Know candidate / primary / foreign keys cold.

ER vocabulary (exam level)

  • Entity set, relationship set (1:1, 1:N, M:N), attributes (simple / composite / multi-valued / derived)
  • Weak entity: identifying relationship + partial key
  • Total vs partial participation

Relational model

Relation = table. Tuple = row. Attribute = column. Schema vs instance.

Keys

KeyMeaning
SuperkeyIdentifies tuples uniquely (may have extras)
Candidate keyMinimal superkey
Primary keyChosen candidate key
Foreign keyReferences a candidate/primary key in another (or same) relation

Trap: calling any unique column “the key” when a composite candidate key is required.

Mapping ER → tables (rules of thumb)

  1. Strong entity → relation with its attributes
  2. 1:N relationship → FK on the N side
  3. M:N → new relation with FKs to both + relationship attributes
  4. Weak entity → relation including owner’s PK + partial key
  5. Multi-valued attribute → separate relation with FK to owner

Integrity

  • Entity integrity: primary key ≠ NULL
  • Referential integrity: FK NULL or matches referenced key
  • Domain constraints on attribute types

Next: Normalization. Hub: GATE.