6 Data Modeling And Database Design

Systems Analysis and Design · Unit 6

Data Modeling and Database Design

Exam-focused notes for Data Modeling and Database Design (Systems Analysis and Design, BIT253): what the TU syllabus asks and how it has actually been tested, with 6 solved past questions from this unit.

Data Modeling and Database Design in short

Every system stores data. This chapter shows how to model data with entity-relationship diagrams. It then turns the model into tables, cleans them by normalization, and tunes them for speed.

Data Modeling and Database Design: notes

Data modeling definition

Data modeling is the process of identifying the data a system needs and showing how the data items relate to each other. The model is drawn as a diagram before any database is built.

It helps to:

  • Understand business data clearly.
  • Avoid duplicate and missing data.
  • Give designers a plan for the database.
  • Help users and developers talk about data in the same way.

There are three levels: conceptual, logical, and physical.

Entity-relationship diagram purpose and examples

An entity-relationship diagram (ERD) is a picture of the entities in a system and the relationships between them.

  • An entity is a person, place, thing, or event about which data is kept, such as Member or Book.
  • An attribute is a property of an entity, such as MemberName.
  • A relationship is a link between entities, such as Member borrows Book.
  • Cardinality shows how many: one-to-one, one-to-many, or many-to-many.
  • An identifier (primary key) uniquely identifies each entity instance.

Example for a college library:

EntityAttributesKey
MemberMemberID, Name, Address, PhoneMemberID
BookBookID, Title, Author, PriceBookID
LoanLoanID, IssueDate, DueDate, ReturnDateLoanID

Relationships: one Member can have many Loans (one-to-many). One Book can appear in many Loans over time (one-to-many). So Member and Book have a many-to-many link, which the Loan entity resolves.

Member (1) ----< Loan >---- (1) Book

Conceptual data model

The conceptual data model is a high-level picture of the main business entities and relationships. It shows what data exists, not how it is stored.

  • It is written in business terms.
  • It leaves out technical details like data types and keys.
  • Users can read and check it.
  • It does not depend on any database product.

For an online shop it shows Customer, Order, Product, and the links between them.

What this unit covers

  • Data modeling definition
  • Entity-relationship diagram purpose and examples
  • Conceptual data model
  • Logical database design
  • Physical database design
  • Normalization definition
  • First normal form
  • Second normal form
  • Index creation factors
  • Goals of designing physical tables
  • Object-oriented database benefits
  • Object identity

Normalization definition

2082 · 5 marks

Define normalization. Explain first and second form of normalization. [1+4]

Show solved answer

Normalization

Definition

Normalization is the process of organizing the attributes and relations of a relational database to minimize data redundancy, eliminate undesirable insertion, deletion, and update anomalies, and ensure data integrity by decomposing larger tables into smaller, well-structured tables based on functional dependencies.


First Normal Form (1NF)

A relation is said to be in First Normal Form (1NF) if:

  • All attributes contain only atomic (indivisible) values (no multi-valued or composite attributes).
  • Each column contains values of a single type.
  • Each row is unique (there is a primary key).
  • There are no repeating groups or arrays in any column.

Example

Not in 1NF (multi-valued attribute):

StudentIDNameCourses
1RamMath, Science
2SitaEnglish

Converted to 1NF:

StudentIDNameCourse
1RamMath
1RamScience
2SitaEnglish

Now each cell holds only one atomic value.


Second Normal Form (2NF)

A relation is said to be in Second Normal Form (2NF) if:

  1. It is already in 1NF, AND
  2. Every non-key attribute is fully functionally dependent on the entire primary key (i.e., there is no partial dependency).

Partial Dependency: A non-key attribute depends on only a part of a composite primary key, not the whole key.

2NF is relevant only when the primary key is composite (made up of two or more attributes).

Example

In 1NF but NOT in 2NF:

StudentIDCourseIDStudentNameCourseNameGrade
1C01RamMathA
1C02RamScienceB
2C01SitaMathA
  • Primary Key: (StudentID, CourseID)
  • StudentName depends only on StudentID (partial dependency)
  • CourseName depends only on CourseID (partial dependency)
  • Grade depends on both StudentID and CourseID (full dependency)

Converted to 2NF (remove partial dependencies):

Student Table:

StudentIDStudentName
1Ram
2Sita

Course Table:

CourseIDCourseName
C01Math
C02Science

Enrollment Table:

StudentIDCourseIDGrade
1C01A
1C02B
2C01A

Now every non-key attribute is fully dependent on the entire primary key.


Summary

Normal FormCondition
1NFNo multi-valued or composite attributes; all values atomic
2NFIn 1NF + No partial dependency on composite primary key
Open this answer on its own page →

Index creation factors

2081 · 5 marks

What factors influence the decision to create an index on a field? What are the goals of designing physical tables? [3+2]

An index is a data structure that speeds up data retrieval. However, creating an index on every field is not always beneficial. The following factors influence the decision: - If a field is frequently used in WHERE clauses, JOIN conditions, or ORDER BY/GROUP BY clauses, creating an index improves...

Open this answer on its own page →

Logical database design

2080 · 5 marks

Define conceptual data model. Explain logical database design in brief. [5]

Show solved answer

Conceptual Data Model and Logical Database Design


Conceptual Data Model (2 marks)

A conceptual data model is a high-level, abstract representation of the data requirements of an organization, independent of any specific database management system (DBMS) or physical implementation details.

It describes what data is stored, the relationships among data, and the constraints on data, without concerning itself with how the data will be physically stored or accessed.

Key characteristics:

  • Technology and DBMS independent
  • Focuses on entities, attributes, and relationships
  • Expressed using tools like Entity-Relationship (ER) diagrams
  • Understandable by both technical and non-technical stakeholders

Example: An ER diagram showing Student, Course, and Enrollment entities with their relationships is a conceptual data model.


Logical Database Design (3 marks)

Logical database design is the process of translating the conceptual data model into a logical structure that can be implemented in a specific type of DBMS (such as a relational DBMS), but still independent of the physical storage details.

Steps in Logical Database Design:

  1. Mapping Entities to Tables (Relations)

    • Each entity in the ER diagram is converted into a relation (table).
    • Attributes of the entity become columns of the table.
  2. Defining Primary Keys

    • A unique identifier (primary key) is assigned to each table to uniquely identify each record.
  3. Handling Relationships

    • One-to-Many: The primary key of the "one" side is placed as a foreign key in the "many" side table.
    • Many-to-Many: A new junction/associative table is created with foreign keys from both related tables.
    • One-to-One: Foreign key is placed in either of the two tables.
  4. Normalization

    • The logical schema is refined by applying normalization (1NF, 2NF, 3NF, etc.) to eliminate data redundancy and update anomalies.
  5. Defining Integrity Constraints

    • Entity integrity, referential integrity, and domain constraints are defined.

Output of Logical Design:

A set of relation schemas with defined attributes, primary keys, and foreign keys, ready to be implemented in a relational DBMS.

Example:

Student (StudentID, Name, Address)
Course  (CourseID, CourseName, Credits)
Enrollment (StudentID, CourseID, Grade)

Note: Logical design bridges the gap between the abstract conceptual model and the physical implementation, ensuring data is organized efficiently and consistently.

Open this answer on its own page →

Data modeling definition

2079 · 5 marks

What is data modeling? Draw an ER diagram to keep records of students, courses, and grades at your college. [5]

Data modeling is the process of creating a conceptual representation of data objects, the associations between different data objects, and the rules governing those objects. It defines how data is connected to each other and how they are processed and stored inside the system. Data modeling helps...

Open this answer on its own page →

Object-oriented database benefits

0 · 5 marks

What are the benefits of object-oriented database? What is object identity? [5]

--- Object-oriented databases combine the features of object-oriented programming with database capabilities. The key benefits are: - OODB can store complex, real-world objects (e.g., images, audio, documents) that are difficult to represent in relational tables. - Supports nested objects and com...

Open this answer on its own page →

Entity-relationship diagram purpose and examples

0 · 5 marks

Why do we need ER diagram during information system development? Explain with example. [5]

An Entity-Relationship (ER) Diagram is a graphical/visual representation of the logical structure of a database. It shows entities, their attributes, and the relationships among them. It was introduced by Peter Chen in 1976. --- ER diagrams provide a clear visual blueprint of the database structu...

Open this answer on its own page →