Documentation
Syntax
Weak entity

Weak Entity expression

The syntax for weak entities is very similar to the one for entities. To declare an entity as weak, we use the depends on keyword followed by a comma-separated list of its identifying relationships. Since weak entities don't have keys but partial keys, we use the pkey keyword to declare an attribute as part of the partial key of a weak entity. Weak entities can have composite attributes just like regular entities. Weak entities can't extend other entities.

In the following example, the weak entity "Evaluation" depends on the entity "Course" through the relationship "of". Also, "Grade" depends on "Evaluation" through the relationship "eval" and on "Student" through "belongs_to".

See the syntax for relationships in case you don't understand the last line.

💡

A weak entity must have total participation in its identifying relationships.

entity Course {
    code key
    name
}
 
entity Evaluation depends on of {
    name pkey
    date
}
 
relation of(Course, Evaluation 1!)
 
entity Grade depends on eval, belongs_to {
    question pkey
    value
}
 
entity Student {
    s_id key
    name
}
 
relation eval(Grade 1!, Evaluation)
relation belongs_to(Grade 1!, Student)
Weak entity with multiple dependencies ER Diagram

Single dependency

entity Course {
  code key
  c_name
} 
 
entity Assignment depends on isPartOf {
  a_name pkey
  due_date
}
 
relation isPartOf(Course, Assignment 1!)
Weak entity ER Diagram