Interactive Data Transforming | Lecture 2
Entity-Relationship Model is a detailed, logical representation of the data for an
organization/business. It’s a way to visualize and design the structure of a database. It’s expressed in
terms of the following concepts:
1. Entities
Entity type
Collection of entities that share common properties or characteristics. For example,
“Car” could be an entity type. It represents all cars in general.
Entity instance
A person, place, object, event, concept. For example, “A red Toyota Corolla with
license plate ABC123”. This is a specific car that belongs to the broader category of
“Car”.
An Entity should be
- An object that will have many instances in the database. For example, if you have an
entity called “Student” the database will have many individual students, each as a
separate instance
- An object that will be composed of multiple attributes. For example, a “Student” entity
might have attributes like “Name, Student, ID, Date of Birth and Email”.
- An object that we are trying to model. For example, if you’re building a database for a
school, “Student”, “Course”, and “Teacher” are all entities that you want to model.
Guidelines for Naming Entity Types
- Singular noun, specific to organization, concise of abbreviation Customer instead of
Customers or Order instead of Ord. This helps keep things clear and consistent.
- For event entities, the result not the process. Use Order Placed instead of Placing Order
- Name consistent for all diagrams Use the same names for entity types throughout all
your diagrams to avoid confusion and ensure clarity.
Strong Entity VS Weak Entity
Strong Entity
Exists independently: A strong entity can stand alone. It doesn’t need any other
entity to exist. For example, a “Car” can exist by itself in a database.
Unique identifier: It has something unique that identifies it, like a car’s VIN (Vehicle
Identification Number
, Weak Entity
Depends on a strong entity: A weak entity can’t exist by itself. It relies on a strong
entity to make sense. For example, a “Car Insurance Policy” might depend on a
specific car to exist. Without the car, the insurance policy doesn’t make sense.
No unique identifier: It doesn’t have a completely unique identifier on its own. It
usually has a partial identifier, like a policy number, but that number might not be
unique without the context of the car it’s related to.
Entity box and partial identifier have double lines Suppose you have a strong entity
called Customer and a weak entity called Order. The Order entity might have a partial
identifier like OrderID. An order is dependent on a customer. Instead, you can
combine OrderID with CustomerID to create a composite key. The weak entity in the
ER diagram will have double lines, and the partial identifier will be underlined with
double lines as well.
2. Attributes:
These are the details about each entity. For a “Student” entity, attributes could be “Name, ID
Number, and Data of Birth.”
Properties of an entity or relationship type.
Required versus Optional
Required Must have a value for every entity (or relationship) instance with which it is
associated In a Customer entity, CustomerID might be a required attribute because every
customer must have an ID
Optional May not have a value for every entity (or relationship) instance with which it is
associated. In a Customer entity, MiddleName might be an optional attribute because not
every customer has to provide a middle name
Composite versus Simple
Composite Below you see a composite attribute. It’s an attribute that has meaningful
component parts (sub-attributes). It’s the attribute that you can break down into smaller,
more specific parts. In this case, Address is the composite attribute and the street address
etc. are the component attributes.
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller iuk. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $3.21. You're not tied to anything after your purchase.