UPI Study › Courses › Software Engineering › Free lessons › Lesson 6.6 Free with a free account
Structuring Information: Data Modeling Basics
Software Engineering · Chapter 6: Requirements Engineering and PrototypingSection 6.6 · lesson 43 of 1037 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Software Engineering.
Lesson complete
Earn the 3 college credits for Software Engineering
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Organizing Data with Class-Based Modeling →← Getting Started with UML: A Visual Modeling LanguageNext lesson: Organizing Data with Class-Based Modeling →
In this lesson
Entities, attributes, relationships, and cardinality.
- Explain what a conceptual data model represents
- Define entity, attribute, and relationship
- Distinguish the 3 types of cardinality
- Read a simple entity-relationship diagram
Transcript
Everything said in the video, section by section (985 words). Read along, or search it.
Requirements Engineering and Prototyping
Structuring Information: Data Modeling Basics
Every action a system performs works on information. Before a system can act on data, someone has to work out what that data looks like. This section covers data modeling at the conceptual level. Entities, attributes, relationships, and cardinality, drawn with the classic entity-relationship notation.
Beneath the Action
What Is an Order, Anyway?
A functional requirement like, let a user submit an order, describes an action. But underneath that action sits information. An order has to actually consist of something. A customer, a set of products, a date, and a total. Data modeling is the practice of working out what that information looks like, and how its pieces relate to one another. It represents the structure of a system's information on its own terms, separately from whatever behavior will later act on it. This section uses the classic entity-relationship notation, built specifically for data. It is different from the class diagrams used to model data and behavior together.
Conceptual Data Models
Independent of Implementation
A conceptual data model represents the structure of the information a system needs to keep track of. It shows what distinct kinds of things the system stores data about, what details matter for each one, and how those things relate. It deliberately stays independent of implementation. It says nothing about how the data will be stored in a database, or represented in code. That is the point. Modeling data before any database exists lets the structure be checked and agreed upon, before it becomes expensive to change.
The Building Blocks
Entities, Attributes, Relationships
A data model has three building blocks. An entity is a distinct kind of thing the system stores information about. A customer, a product, an order. An entity is a category, not one specific instance. Customer is the entity. One particular customer is an instance of it. An attribute is a specific piece of information describing an entity. A customer might have an ID, a name, and an email address. And a relationship is an association between two entities. A customer places an order. An order contains products. A relationship captures a fact about how the business works, not just a technical link.
Figure 6.6A
An Entity-Relationship Diagram
Here is a classic entity-relationship diagram. The three rectangles are entities. Customer, Order, and Product. The ovals attached to each rectangle are attributes. A customer has an ID, a name, and an email. An order has an ID, a date, and a total. The diamonds are relationships. A customer places an order, and an order contains products. And the one and M on the lines give the cardinality. One customer places many orders. And many orders contain many products.
Cardinality
How Many Relate to How Many
A relationship alone does not say how many instances can connect. That is what cardinality describes. Three patterns cover most real relationships. In a one-to-one relationship, exactly one instance on each side connects. One employee is assigned exactly one parking space. In a one-to-many relationship, one instance connects to several. One customer places many orders, while each order belongs to only one customer. And in a many-to-many relationship, several instances connect on both sides. Many students enroll in many courses, and each course has many students. These same three patterns repeat across almost every conceptual data model.
Reading the Diagram
3 Shapes, Used Consistently
Reading an entity-relationship diagram comes down to three shapes, used consistently. A rectangle is an entity. An oval attached to an entity is one of its attributes. A diamond is a relationship, connected to the two entities it relates. And cardinality is written directly on the connecting lines, usually as a one or an M. Notice what the diagram leaves out. It describes the shape of information alone, not the operations that will act on it.
Table 6.6
The Building Blocks at a Glance
Here are the building blocks at a glance. An entity is a distinct kind of thing the system stores data about, like a customer, an order, or a product. An attribute is a piece of information describing an entity, like a customer's name or email. A relationship is an association between two entities, like a customer placing an order. And cardinality is how many instances on each side can take part. For example, one customer, and many orders.
Think About It
Model a Library
Here is a question to think about. Picture a library. Two entities it would track are members and books. A member might have a card number, and a book an I S B N. The relationship between them is that a member borrows a book. So which cardinality? Over time, one member borrows many books, and one book is borrowed by many members. That makes it many to many. And notice what decided it. A real fact about how libraries work.
Apply It
Does 1 Author Write Each Book?
Let's apply that to a tricky case. A new analyst models a writes relationship between author and book as one to many, reasoning that one author writes many books. What real-world case breaks that? A book with several co-authors. Books can have many authors, and authors can write many books. So the correct cardinality is many to many.
Key Terms
The Vocabulary of This Section
Let's lock in the key terms. A conceptual data model represents the structure of a system's information, independent of how it will be implemented. An entity is a distinct kind of thing a system stores information about, and an attribute is a piece of information describing it. A relationship is an association describing how instances of two entities connect. Cardinality is how many instances on each side can relate. One to one, one to many, or many to many. And an entity-relationship diagram uses rectangles, ovals, and diamonds for entities, attributes, and relationships.
Key Takeaways
What to Carry Forward
To pull this together. Data modeling represents the structure of a system's information, independently of the behavior that will act on it. Its three building blocks are entities, attributes, and relationships. Cardinality describes how many instances can take part on each side. One to one, one to many, or many to many. Entity-relationship diagrams show entities as rectangles, attributes as ovals, and relationships as diamonds, with cardinality on the lines. And real-world facts, like books with co-authors, are what decide the right cardinality.
About Software Engineering at UPI Study
Software Engineering (Computer Science 301) is a self-paced online course of 103 video lessons in 15 chapters, from process models and agile to requirements, design, user interfaces, reliability, security and project management. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Computer Science courses Every course with PRO →
Why take it here
Why students take Software Engineering with UPI Study
Where the credit goes
Universities that work with NCCRS
Software Engineering carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Structuring Information: Data Modeling Basics
What is a conceptual data model?
What is the difference between an entity, an attribute, and a relationship?
What are the three types of cardinality in data modeling?
What do the shapes in an entity-relationship diagram mean?
About the Software Engineering course
How many college credits is Software Engineering?
How much does Software Engineering cost and what is included?
Which universities accept UPI Study credits?
How long does Software Engineering take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Software Engineering.
103 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
3 credits · NCCRSEnroll →