IDEF1X notation: how to read an IDEF1X diagram

IDEF1X is the FIPS 184 notation for relational data models. How to read an IDEF1X diagram symbol by symbol, with SQL Server tables of a university.

What is IDEF1X?

IDEF1X (Integration Definition for Information Modeling) is a notation for relational data models: entities are boxes that list their attributes and keys, and relationships are lines that carry a parent’s key into a child. It came out of the US Air Force’s ICAM program in the 1980s as IDEF1 Extended, hence the X, and was published in 1993 as a federal standard, FIPS 184, which defines every symbol. The section numbers below are its own. NIST withdrew FIPS 184 in 2008, and IDEF1X continues as ISO/IEC/IEEE 31320-2:2012 (IDEF1X97), whose key style stays compatible with it. ER diagram symbols sets its marks beside crow’s foot and Chen.

An IDEF1X diagram shows entities, their attributes and keys (primary, alternate and foreign), and the relationships between them. The standard has three levels of view (3.10), from entity-relationship views with no keys to fully attributed views with every attribute. A diagram drawn from SQL tables is the fully attributed kind, so each many-to-many is already a table of its own (3.7.3).

The example is a university, a smaller cut of the university database template: departments employ instructors and offer courses, courses run in numbered sections, and students enroll in sections. Every script below runs on SQL Server, and each diagram is drawn from its script. Three tables stand on their own:

CREATE TABLE dbo.Department (
    DepartmentId int NOT NULL
        CONSTRAINT PK_Department PRIMARY KEY,
    Code varchar(10) NOT NULL
        CONSTRAINT AK_Department_Code UNIQUE,
    Name nvarchar(100) NOT NULL
        CONSTRAINT AK_Department_Name UNIQUE
);

CREATE TABLE dbo.Instructor (
    InstructorId int NOT NULL
        CONSTRAINT PK_Instructor PRIMARY KEY,
    DepartmentId int NOT NULL
        CONSTRAINT FK_Instructor_Department
        REFERENCES dbo.Department (DepartmentId),
    Email varchar(254) NOT NULL
        CONSTRAINT AK_Instructor_Email UNIQUE,
    Name nvarchar(100) NOT NULL
);

CREATE TABLE dbo.Course (
    CourseId int NOT NULL
        CONSTRAINT PK_Course PRIMARY KEY,
    DepartmentId int NOT NULL
        CONSTRAINT FK_Course_Department
        REFERENCES dbo.Department (DepartmentId),
    CourseNumber smallint NOT NULL,
    Title nvarchar(200) NOT NULL,
    CONSTRAINT AK_Course_DepartmentId_CourseNumber
        UNIQUE (DepartmentId, CourseNumber)
);
IDEF1X diagram of dbo.Department, dbo.Instructor and dbo.Course in square boxes; dashed lines from Department to Instructor and to Course, each with a dot at the child; Code (AK1) and Name (AK2) in Department, Email (AK) in Instructor, DepartmentId (FK,AK1.1) and CourseNumber (AK1.2) in Course.
Three independent entities: square corners, the primary key above the line. Course's alternate key is two columns, numbered AK1.1 and AK1.2.

How to read an IDEF1X entity box

Each box is read top to bottom:

  • The entity’s name sits above the box (3.1.2).
  • The primary key’s attributes sit at the top, above a line across the box; every other attribute goes below it (3.4.2). The primary key has no designator; its place above the line marks it.
  • A foreign key attribute is followed by (FK) (3.9.2). Instructor.DepartmentId (FK) is the department’s key, migrated into the instructor.
  • An alternate key, any candidate key other than the primary key (2.35), is written (AK1), (AK2) and so on after each of its attributes (3.8.2). dbo.Department has two: Code is AK1, Name is AK2.

FIPS 184 puts the same (AK1) on every attribute of a key with several columns. The diagrams here number the column’s place in the key as well, so the two columns of Course’s key read AK1.1 and AK1.2, and a table’s lone one-column key, Instructor.Email, reads plain AK.

That two-column key says course numbers repeat across departments: CS has a 101 and so does MATH. Neither column is unique alone; the pair is. In SQL Server an alternate key is a UNIQUE constraint:

INSERT INTO dbo.Department (DepartmentId, Code, Name)
VALUES (1, 'CS', N'Computer Science'),
       (2, 'MATH', N'Mathematics');

INSERT INTO dbo.Course
    (CourseId, DepartmentId, CourseNumber, Title)
VALUES (10, 1, 101, N'Introduction to Programming'),
       (11, 2, 101, N'Calculus I');

INSERT INTO dbo.Course
    (CourseId, DepartmentId, CourseNumber, Title)
VALUES (12, 1, 101, N'Programming for Everyone');
Msg 2627, Level 14, State 1, Line 10
Violation of UNIQUE KEY constraint 'AK_Course_DepartmentId_CourseNumber'. Cannot insert duplicate key in object 'dbo.Course'. The duplicate key value is (1, 101).
The statement has been terminated.

MATH 101 goes in beside CS 101, and a second CS 101 fails on AK_Course_DepartmentId_CourseNumber.

Independent and dependent entities: square and rounded boxes

FIPS 184 sorts entities by how their rows are identified (3.1.1). An independent entity can identify each row without knowing its relationship to another entity, and its box has square corners. A dependent entity can’t: its primary key holds a parent’s whole primary key, and its box has rounded corners (3.1.2, rule 3.1.3 e).

Section numbers start again in every course, so a section is known only with its course: a dependent entity. So is an enrollment, known by its student and its section:

CREATE TABLE dbo.Section (
    CourseId int NOT NULL
        CONSTRAINT FK_Section_Course
        REFERENCES dbo.Course (CourseId),
    SectionNumber smallint NOT NULL,
    InstructorId int NOT NULL
        CONSTRAINT FK_Section_Instructor
        REFERENCES dbo.Instructor (InstructorId),
    CONSTRAINT PK_Section
        PRIMARY KEY (CourseId, SectionNumber)
);

CREATE TABLE dbo.Student (
    StudentId int NOT NULL
        CONSTRAINT PK_Student PRIMARY KEY,
    Name nvarchar(100) NOT NULL
);

CREATE TABLE dbo.Enrollment (
    StudentId int NOT NULL
        CONSTRAINT FK_Enrollment_Student
        REFERENCES dbo.Student (StudentId),
    CourseId int NOT NULL,
    SectionNumber smallint NOT NULL,
    Grade char(2) NULL,
    CONSTRAINT PK_Enrollment
        PRIMARY KEY (StudentId, CourseId, SectionNumber),
    CONSTRAINT FK_Enrollment_Section
        FOREIGN KEY (CourseId, SectionNumber)
        REFERENCES dbo.Section (CourseId, SectionNumber)
);
IDEF1X diagram of the three tables before plus dbo.Section, dbo.Student and dbo.Enrollment; solid lines from Course to Section, from Section to Enrollment and from Student to Enrollment; a dashed line from Instructor to Section; Section and Enrollment in rounded boxes, each holding a parent's key columns, marked (FK), above the line; a dot at every child end.
Section and Enrollment have rounded corners: their primary keys hold a parent's whole key. Grade allows NULL, which FIPS 184 marks (O); the IDEF1X look shows names and key designators only.

dbo.Section has CourseId (FK) and SectionNumber above its line. dbo.Enrollment has three key attributes, all (FK): the student’s key and the section’s two-column key. Its grade goes below the line. dbo.Student and dbo.Instructor keep their square corners; a box is rounded by its own key, never by its children’s.

The lines say the same from the relationship’s side. When every column of a foreign key is also in the child’s primary key, the relationship is identifying: the child can’t be named without its parent. IDEF1X draws an identifying relationship as a solid line , and its child is always a dependent entity (3.5.2.1). Any other relationship is non-identifying, a dashed line (3.5.2.2): Instructor to Section, where InstructorId (FK) sits below the line. The weak entity post goes further into identifying relationships and when a surrogate key replaces them.

A categorization relationship (3.6) also makes dependent entities. A category entity is a subtype of a generic entity: each of its rows is the same real thing as one generic row. Some instructors are professors with a tenure date, some are lecturers with a contract, and a visiting instructor is neither. In SQL Server each category is a table whose primary key is also its foreign key to the generic table:

ALTER TABLE dbo.Instructor
    ADD InstructorType char(1) NOT NULL
        CONSTRAINT DF_Instructor_InstructorType DEFAULT 'V';

CREATE TABLE dbo.Professor (
    InstructorId int NOT NULL
        CONSTRAINT PK_Professor PRIMARY KEY
        CONSTRAINT FK_Professor_Instructor
        REFERENCES dbo.Instructor (InstructorId),
    TenuredOn date NULL
);

CREATE TABLE dbo.Lecturer (
    InstructorId int NOT NULL
        CONSTRAINT PK_Lecturer PRIMARY KEY
        CONSTRAINT FK_Lecturer_Instructor
        REFERENCES dbo.Instructor (InstructorId),
    ContractEndsOn date NOT NULL
);
IDEF1X categorization: dbo.Instructor in a square box over a circle with one underline and InstructorType beside it; solid lines from the circle to dbo.Professor and dbo.Lecturer, rounded boxes whose primary key is InstructorId (FK).
Professor and Lecturer as categories of Instructor. Drawn for this post: ERDsmith doesn't draw the category circle.

One line under the circle means an incomplete set, which leaves room for the visiting instructor; two lines would mean every instructor is a professor or a lecturer (3.6.2). The discriminator, InstructorType, is written beside the circle, and its value says which category a row is in. Category entities are always dependent. SQL Server checks only the keys, though: instructor 100 went into both tables while its InstructorType still said V, for visiting.

Optional relationships and role names

A non-identifying relationship is mandatory or optional. In a mandatory one every child row has a parent row (2.51); in an optional one a child row can exist without one (2.55). FIPS 184 draws the optional kind with a small diamond at the parent end of the dashed line (3.5.2.4). In SQL the difference is one word on the foreign key column: NULL or NOT NULL.

Some sections are team-taught. A second instructor is a second foreign key to dbo.Instructor, nullable because most sections have only one:

ALTER TABLE dbo.Section
    ADD CoInstructorId int NULL
        CONSTRAINT FK_Section_Instructor_CoInstructorId
        REFERENCES dbo.Instructor (InstructorId);
IDEF1X diagram of the university's six tables with two dashed lines from dbo.Instructor to dbo.Section: one for InstructorId with no diamond, one for CoInstructorId.InstructorId (FK) with a hollow diamond at Instructor.
Two lines between the same two tables. CoInstructorId allows NULL, so its line has the diamond; InstructorId is NOT NULL, so its line has none.
INSERT INTO dbo.Instructor
    (InstructorId, DepartmentId, Email, Name)
VALUES (100, 1, 'ada@uni.example', N'Ada Byron'),
       (101, 1, 'alan@uni.example', N'Alan Turing');

INSERT INTO dbo.Section
    (CourseId, SectionNumber, InstructorId, CoInstructorId)
VALUES (10, 1, 100, 101),
       (10, 2, 101, NULL);

INSERT INTO dbo.Section
    (CourseId, SectionNumber, InstructorId, CoInstructorId)
VALUES (10, 3, NULL, 100);
Msg 515, Level 16, State 2, Line 11
Cannot insert the value NULL into column 'InstructorId', table 'University.dbo.Section'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Section 10-2 goes in with no co-instructor, which the diamond allows; SQL Server checks a foreign key value against its parent only when it isn’t NULL. Section 10-3 without its main instructor fails with Msg 515: that line has no diamond.

The new column also shows what IDEF1X does when a parent’s key arrives twice. A table can’t hold two columns named InstructorId, and the standard asks for a different name for each occurrence that can hold its own value (3.9.1.1).

That name is a role name, “a name assigned to a foreign key attribute to represent the use of the foreign key in the entity” (2.58). It is written as the role name, a period and the migrated attribute’s name (3.9.2.1, 3.14.3): CoInstructorId.InstructorId (FK). Read it as “CoInstructorId, which holds an InstructorId”. 3.9.1 lets the role name go on one occurrence or both; 3.9.1.1, read strictly, wants one on each, which would make the first LeadInstructorId.InstructorId. SQL Server only needs the two names to differ, so the diagrams keep InstructorId.

Cardinality: the dot, P, Z and numbers

Every relationship line ends in a filled dot at the child (3.5.2). The dot alone means zero, one or more child rows for each parent row, the plain one-to-many. Something written beside the dot narrows it:

  • P : one or more, P for positive.
  • Z : zero or one.
  • A number beside the dot : exactly that many, such as 3; a range, such as 2-5, from the first to the second.

The parent’s end carries no letter: a child row has at most one parent in a relationship (2.57), and the diamond already says whether it may have none.

Each section has at most one final exam, and the exam is known by its section:

CREATE TABLE dbo.FinalExam (
    CourseId int NOT NULL,
    SectionNumber smallint NOT NULL,
    Room varchar(20) NOT NULL,
    StartsAt datetime2(0) NOT NULL,
    CONSTRAINT PK_FinalExam
        PRIMARY KEY (CourseId, SectionNumber),
    CONSTRAINT FK_FinalExam_Section
        FOREIGN KEY (CourseId, SectionNumber)
        REFERENCES dbo.Section (CourseId, SectionNumber)
);
IDEF1X diagram of the university's tables plus dbo.FinalExam in a rounded box, its primary key CourseId (FK) and SectionNumber (FK); a solid line from dbo.Section to dbo.FinalExam with a dot and Z at FinalExam; plain dots at the other child ends.
FinalExam's foreign key is its whole primary key, so a section has zero or one exam: the dot with Z. The line is solid and the box rounded for the same reason.
INSERT INTO dbo.FinalExam
    (CourseId, SectionNumber, Room, StartsAt)
VALUES (10, 1, 'B-204', '2026-12-14T09:00:00');

INSERT INTO dbo.FinalExam
    (CourseId, SectionNumber, Room, StartsAt)
VALUES (10, 1, 'C-110', '2026-12-15T14:00:00');
Msg 2627, Level 14, State 1, Line 5
Violation of PRIMARY KEY constraint 'PK_FinalExam'. Cannot insert duplicate key in object 'dbo.FinalExam'. The duplicate key value is (10, 1).
The statement has been terminated.

The second final for section 10-1 fails on PK_FinalExam. That is what a Z stands on in SQL Server: a foreign key whose columns are also the child’s primary key or a unique key.

P and numbers have no constraint behind them. A foreign key checks each child row against its parent, never that a parent has children: course 11, Calculus I, went in with no sections at all. “Every course runs at least one section” is a P, and it lives in the application or a trigger. A diagram read from the tables can only show the plain dot or the Z .

How ERDsmith helps

dbo.FinalExam’s rounded box , solid line and Z all come from its foreign key being its whole primary key, and the diamond on CoInstructorId’s line from a NULL. ERDsmith reads each mark from the tables, so a box and its key can’t disagree:

  • Take SectionNumber out of dbo.FinalExam’s primary key and its line from dbo.Section turns dashed and its box square ; put it back and both return.
  • Make CoInstructorId NOT NULL and the diamond leaves its line; the solid lines into dbo.Section and dbo.Enrollment never get one.
  • Drawing a second line from dbo.Instructor to dbo.Section asks for a role name or a cancel; named CoInstructorId, the column reads CoInstructorId.InstructorId.
  • Import the university’s script and dbo.FinalExam gets its Z from PK_FinalExam, while the enrollment lines keep the plain dot .