Diagram Desk

One-to-one relationship ERD

A small ERD showing one-to-one: each member has at most one profile, which may not exist yet (zero or one).

The diagram

MemberPK member_id intemail varcharMemberProfilePK member_id intbio varcharphoto_url varcharhas
ER diagram · 7 shapes

Reading it step by step

  • 'Member' has 2 attributes, primary key member_id.
  • 'MemberProfile' has 3 attributes, primary key member_id.
  • Each 'Member' relates to zero or one 'MemberProfile'; each 'MemberProfile' to exactly one 'Member' (has).

Shape by shape

ShapeSymbolConnections
MemberEntityholds member_id, email · → MemberProfile(has)
MemberProfileEntityholds member_id, bio, photo_url · ← Member

Using this example

Use one-to-one only when there is a reason to split: keep sign-up essentials in Member and optional or bulky fields (bio, photo URL) in the profile so the main table stays small. In exams, state both sides in words, "one member has zero or one profile".

Symbols used here

SymbolMeaning
EntityA thing to store: name on top, attributes below.
Primary key (PK)The attribute that identifies one row; underlined.
Exactly oneTwo short bars at the line end.
Zero or oneA bar and a circle.

All er diagram symbols and how to draw

Diagram text

Paste this text into the editor to get the same picture, then change the names to fit your own work.

# One-to-one relationship ERD
erDiagram
  Member {
    int member_id PK
    varchar email
  }
  MemberProfile {
    int member_id PK
    varchar bio
    varchar photo_url
  }
  Member ||--o| MemberProfile : has

More er diagram examples

All SeewolLabs tools