An object that exists and is distinguishable from other objects
Entity
Specific person, company, event, plant
Entity set
A set of entities of the same type that share the same properties
Entity set
Set of all persons, companies, trees, holidays
Attribute
Descriptive properties possessed by all members of an entity set
Attributes
ID, name, street, city, salary (for instructor entity set)
course_id, title, credits (for course entity set)
Domain
The set of permitted values for each attribute
Attribute types
Simple and composite attributes
Single-valued and multivalued attributes
Derived attributes
Simple attribute
Attribute that consist of a single atomic value
Simple attribute
Salary
Composite attribute
Attribute value not atomic
Composite attributes
Address: 'House_no:City: State'
Name : 'First Name: Middle Name: Last Name'
Single valued attribute
Attribute that hold a single value
Single valued attributes
City
Customer id
Multi valued attribute
Attribute that hold multiple values
Multi valued attributes
A customer can have multiple phone numbers, email id's
A person may have several college degrees
Derived attribute
An attribute that's value is derived from a stored attribute
Derived attribute
Age, derived from the stored attribute Date of Birth
A relationship is an association among several entities
Types of relationships
One-to-one relationship (1:1)
One-to-many relationship (1:M)
Many-to-many relationship (M:N)
Cardinality constraints are expressed by drawing either a directed line (→), signifying "one," or an undirected line (-), signifying "many," between the relationship set and the entity set
Cardinality constraints can also be expressed by numbering each entity. * or, m for many
One-to-one relationship
A student is associated with at most one instructor via the relationship advisor
A student is associated with at most one department via stud_dept
One-to-many relationship
An instructor is associated with several (including 0) students via advisor
Many-to-many relationship
An instructor is associated with several (possibly 0) students via advisor
A student is associated with several (possibly 0) instructors via advisor
Candidate key
A minimal super key of an entity set
Candidate keys
ID is candidate key of instructor
course_id is candidate key of course
Primary key
A candidate key that is most appropriate to be the main reference key for the table. It must contain unique values, must never be null and uniquely identify each record in the table
Foreign key
A primary key from one table that appears as a field in another where the first table has a relationship to the second
Super key
A set of one or more attributes whose values uniquely determine each entity
Super keys
{Student ID, FirstName}
{Student ID, LastName}
{Student ID, FirstName, LastName}
Rectangles represent entity sets, diamonds represent relationship sets, attributes listed inside entity rectangle or as oval shape along with the rectangle, underline indicates primary key attributes
Crows foot notation is a common method of indicating cardinality, using symbols like single bar, double bar, circle, and crows foot
A weak entity set does not have a primary key, its discriminator is underlined with a dashed line, and its identifying relationship is in a double diamond
Generalization is a bottom-up approach where lower level entities combine to form a higher level entity, specialization is the opposite top-down approach
Aggregation is when a relationship between two entities is treated as a single entity
UML class diagrams correspond to ER diagrams, with some differences in notation