CH # 2 (DBMS)
CH # 2 (DBMS)
Data models are crucial for organizing and structuring data in a way that supports efficient
storage, retrieval, and analysis. They help ensure data consistency, reduce redundancy, and
improve data integrity. A well-designed data model also facilitates better decision-making by
providing a clear understanding of the relationships between different data entities.
Data models are widely used in various industries, including finance, healthcare, and e-
commerce, to manage complex data systems and drive business insights.
Business Rule: .-----(( A business rule is a brief, precise, and unambiguous description of a
policy, procedure, or principle within a specific organization. In a sense, business rules are
misnamed: they apply to any organization, large or small—a business, a government unit, a
religious group, or a research laboratory—that stores and uses data to generate
information.))-------
A business rule is a formal statement that defines or constrains some aspect of a business. It
describes operations, definitions, or constraints that apply to an organization’s data and
processes.
Defines Data Requirements: Helps identify what data is needed and how it should be
used.
Ensures Accuracy: Ensures the data stored reflects real-world situations accurately.
Guides Model Structure: Helps create relationships between entities (e.g., "A customer
can place many orders").
Supports Consistency: Keeps the database consistent with the organization's policies
and procedures.
3. How do you translate business rules into data model components?
Business rules are translated into the components of a data model by identifying:
Steps:
4. Describe the basic features of the relational data model and discuss their importance to the
end user and the designer.
1. Tables (Relations):
2. Rows (Tuples):
3. Columns (Attributes):
4. Primary Key:
o A unique identifier for each record in a table.
5. Foreign Key:
6. Data Integrity:
Data Access: Can retrieve and manipulate data using simple queries.
Importance to Designers:
Data Integrity: Ensures consistent data relationships through constraints and keys.
5. How did the ER model help create a more structured relational database design
environment?
The Entity-Relationship (ER) model provides a visual and conceptual tool for designing
databases.
Entities:
Relationship:
[CustomerID] [PaymentID]
Objects represent more complex real-world concepts, including how data behaves.
Object: An instance of a class, containing actual data and the ability to perform
behaviors.
Class: Customer
Methods: makePayment()
Class: Payment
Methods: getDetails()
OR
Great! Let’s solve Question #9 using the reference from:
Question #6:
“A customer can make many payments, but each payment is made by only one customer.”
Figure 2.4:
A visual comparison of how the same conceptual model is represented in:
We’ll now model the Customer–Payment relationship as shown in Figure 2.4’s three-part comparison
(OO, UML, ER), but using “Payment” instead of “Invoice”.
PAYMENT
────────────────────────────
PAYMENT_DATE
PAYMENT_AMOUNT
PAYMENT_METHOD
CUSTOMER 1
PAYMENT M
+----------------+ +--------------------------+
| CUSTOMER |1 *| PAYMENT |
+----------------+-------+--------------------------+
| | | PAYMENT_DATE : Date |
| | | PAYMENT_AMOUNT : Double |
| | | PAYMENT_METHOD : String |
+----------------+ +--------------------------+
| ^
| |
makes made by
Optional labels like “makes” and “made by” describe the direction.
🔷 3. ER Model
Relationship: makes
Cardinality:
o CUSTOMER (1)
o PAYMENT (M)
+-----------+ +--------------------+
| PAYMENT_DATE |
| PAYMENT_AMOUNT |
| PAYMENT_METHOD |
+--------------------+
Types:
1. One-to-One (1:1)
2. One-to-Many (1:M)
3. Many-to-Many (M:N)
M:N: Students enroll in many courses, and each course has many students.
A relational diagram visually shows tables and their relationships using keys.
Example:
(1:M relationship shown with one line on left and crow’s foot on right)
Big Data involves extremely large and complex data sets that traditional databases can't
handle.
Big Data refers to a movement to find new and better ways to manage large amounts of
web-generated data and derive business insight from it, while, at the same time,
providing high performance and scalability at a reasonable cost
Components:
1. HDFS – Hadoop Distributed File System (storage) designed to manage large
amounts of data at high speeds.
Relational Model:
Key-Value Model:
"Patient:123": {
"Name": "Ali",
"Tests": [
Ability to change the physical storage (e.g., indexing, partitioning) without affecting the
logical schema or application.
Problems
Thanks! To answer your questions about Problems 1–5 using Figure 2.1 and Figure P2.4, I’ll explain
based on standard textbook versions (commonly used in courses like yours). Since I can’t view the
actual figures you referenced, I’ll describe typical contents of Figure 2.1 and Figure P2.4 from
Cengage’s Database Systems (12th or 13th Edition), often used in your course.
If your version is different, feel free to upload a screenshot or describe the diagram!
Business Rules:
[AgentID] (FK)
Object-Oriented Representation:
Class: Agent
Class: Customer
+----------------+ 1 * +------------------+
|----------------| |------------------|
| AgentID | | CustomerID |
| Name | | Name |
+----------------+ +------------------+
REGION(RegionID, RegionName)
Problem 4: Identify each relationship type and write the business rules
1. REGION to STORE
1:M relationship
Business Rule: One region can contain many stores, but each store is located in only one
region.
2. STORE to EMPLOYEE
1:M relationship
Business Rule: One store can have many employees, but each employee works at one store.
If your diagrams include more entities or attributes, just upload or describe them, and I’ll update this
with exact answers and diagrams!
Would you like me to draw the ERD or UML diagrams for you visually?
You're tackling a deep set of exercises—great job sticking with it! Since these are textbook problems
that reference figures like P2.4, P2.6, etc., which I can't directly see, I’ll continue helping based on
standard versions of these diagrams commonly found in the Database Systems textbook by Coronel &
Morris.
Let’s start with Problems 5 to 12, and I’ll break them down for you step by step:
[RegionID] [StoreID]
REGION to STORE → 1:M
Business Rules:
1. A student can enroll in many classes, but each class can have many students → M:N (resolved
via ENROLLMENT).
2. A professor teaches many classes, but each class is taught by one professor → 1:M.
3. A course can generate many classes, but each class is for only one course → 1:M.
4. A department offers many courses and has many professors, but each course and professor
belongs to one department → 1:M.
Simplified ERD:
^ ^
| |
Simplified structure:
a. Business Rules:
[PatientID] [OrderID]
a. Tables:
b. Relationships:
|----------------|-------|----------------|-------|----------------|
| GalleryID (FK) |
+----------------+
Would you like me to go ahead and create the diagrams for Problems 13 to 17 too?
Or if you want the actual visual ERDs or UML diagrams, I can generate those as images!
Ah, got it! Thanks for pointing that out. Let’s continue from Problem 13 onward, based on your
textbook and image. Here's the detailed solution:
Since the figure isn't provided here, we’ll proceed with a general format to help you describe such
ERDs in the future.
Business Rules:
ERD Relationships:
(You can upload the image if you'd like an exact answer from the figure.)
Assuming it’s about books, authors, and publishers (as typical in P2.15), the business rules might be:
Great! Let’s now work through Problems 16 and 17 using the content from the image you provided.
Let’s convert each description into business rules and outline the corresponding Crow’s Foot ERD
relationships:
a. MegaCo Corporation
Business Rules:
Relationships:
b. BooksOnline Downloads
Business Rules:
Relationship:
CUSTOMER (M) —— (M) EBOOK (This is a many-to-many relationship, which may require a
junction table like DOWNLOAD.)
c. Airliner Flights
Business Rules:
Relationship:
d. KwikTite Corporation
Business Rules:
Relationships:
Business Rules:
Relationship:
Entities:
THEATER
MOVIE
REVIEW
REVIEWER
Relationships:
Based on the Entity Relationship Diagram (ERD) shown in Figure P2.17, the following business rules
are reflected:
1. **Theater shows Movies**: The ERD shows a one-to-many relationship between the "THEATER"
and "MOVIE" entities, indicating that a theater can show multiple movies.
2. **Reviewer writes Reviews**: The ERD shows a one-to-many relationship between the "REVIEWER"
and "REVIEW" entities, indicating that a reviewer can write multiple reviews.
3. **Reviews are written for Movies**: The ERD shows a one-to-many relationship between the
"MOVIE" and "REVIEW" entities, indicating that a movie can have multiple reviews written for it.
4. **Reviewers receive Movies**: The ERD shows a one-to-many relationship between the "MOVIE"
and "REVIEWER" entities, indicating that a reviewer can receive multiple movies.