4 Design

System Analysis and Design · Unit 4 · 7 hrs

Design

Exam-focused notes for Design (System Analysis and Design, CSC326): what the TU syllabus asks and how it has actually been tested, with 9 solved past questions from this unit.

Design in short

Design bridges the problem domain and the working system: having established what the system must do, this chapter turns that specification into a database, physical files, and the forms, reports, interfaces and dialogues through which people actually use it.

Design: notes

Designing Databases

Database design organises data according to a database model, producing logical and physical designs that meet user requirements at high performance. Logical database design proceeds in four steps: develop a logical data model for each known user interface using normalization; combine the normalized requirements of every interface into one consolidated logical model; translate the conceptual E-R model of the application into the same form; then compare the consolidated model against the translated E-R model to produce one final logical database design.

Relational Database Model

The relational database model represents data as related tables (relations), each a set of columns (attributes) and rows (tuples, or records); it captures the logical view of how data is stored, independent of physical storage. A domain is the set of indivisible values an attribute may take. For example, a Student relation with attributes Stu-Id, Stu-name, Stu-address, Dept-Id has one tuple per student. Every relation must obey a few properties: it has a unique name; no two attributes share a name; every attribute has a distinct name; no two tuples are duplicates; every tuple has exactly one value per attribute; and tuples and attributes need not follow any particular order.

Normalization

Normalization minimises redundancy in a relation, since redundancy causes insertion, deletion and update anomalies; it works like a filtering process that successively improves design quality. The normal form of a relation is the highest normal-form condition it satisfies. De-normalization is the reverse: deliberately adding redundancy to speed up complex multi-table joins. A functional dependency $X \rightarrow Y$ between attribute sets $X, Y \subseteq R$ means that any two tuples agreeing on $X$ must also agree on $Y$.

First normal form (1NF) requires that a relation contain no composite or multi-valued attribute. A STUDENT relation with a multi-valued STUD_PHONE column (a student with two phone numbers stored in one row) violates 1NF; it is repaired by giving each phone number its own row:

STUD_NOSTU_NAMESTU_PHONESTU_ADDRESS
1RAM9816271721Kathmandu
1RAM9817712717Kathmandu
2SURESH9810162117Butwal

Second normal form (2NF) requires 1NF plus no partial dependency: a non-prime attribute (one not part of any candidate key) must not depend on only part of a composite candidate key (a minimal key; its members are prime attributes). Consider an ENROLLMENT relation keyed by (Stud_no, Course_no):

Stud_noCourse_noCourse_fee
1C110000
2C215000
1C420000
4C310000
4C110000
2C520000

Here Course_fee depends only on Course_no, a proper subset of the key, not on the full (Stud_no, Course_no) pair; this partial dependency violates 2NF and repeats the fee every time a course is taken. Splitting it removes the redundancy:

$$\text{ENROLLMENT}(\underline{\text{Stud_no}}, \underline{\text{Course_no}}), \qquad \text{COURSE}(\underline{\text{Course_no}}, \text{Course_fee}).$$

Third normal form (3NF) requires 2NF plus no transitive dependency on a non-prime attribute: if $A \rightarrow B$ and $B \rightarrow C$ both hold, then $A \rightarrow C$ is transitive, and $C$ should not be stored in a relation keyed on $A$. An EMPLOYEE relation (Emp_no, Emp_name, Dept_no, Dept_name) has $\text{Emp_no} \rightarrow \text{Dept_no} \rightarrow \text{Dept_name}$, so Dept_name depends on Emp_no only transitively, through Dept_no; it should move to its own relation:

$$\text{EMPLOYEE}(\underline{\text{Emp_no}}, \text{Emp_name}, \text{Dept_no}), \qquad \text{DEPARTMENT}(\underline{\text{Dept_no}}, \text{Dept_name}).$$

What this unit covers

  • Designing Databases: Introduction
  • Database Design
  • Relational Database Model
  • Normalization
  • Transforming E-R Diagrams Into Relations
  • Merging Relations
  • Physical File and Database Design
  • Designing Fields
  • Designing Physical Tables
  • Designing Forms and Reports: Introduction
  • Designing Forms and Reports
  • Formatting Forms and Reports
  • Assessing Usability
  • Designing Interfaces and Dialogues: Introduction
  • Designing Interfaces and Dialogues
  • Interaction Methods and Devices
  • Designing Interfaces
  • Designing Dialogues
  • Designing Interfaces and Dialogues in Graphical Environments

Designing Dialogues

2082 · 5 marks

Explain the steps involved in the dialogue design process. [5]

Dialogue design focuses on the sequencing of interface displays and defines the manner in which humans and computers exchange information. The process of designing the overall sequences that users follow to interact with an information system is called dialogue design. --- This is the first and m...

Open this answer on its own page →

Designing Physical Tables

2082 · 5 marks

Describe the process of designing physical tables. [5]

A physical table is a named set of rows and columns that specifies fields in each row of the table. It is the concrete implementation of logical data structures in secondary storage. --- The design of a physical table has two primary goals: 1. Efficient use of secondary storage - relates to how d...

Open this answer on its own page →

Designing Interfaces

2081 · 5 marks

How do you think effective interfaces can be designed? Explain. [5]

A user interface (UI) is the front-end application view through which a user interacts with software. Effective interface design makes software more popular, usable, and efficient. The software becomes more popular if its user interface is attractive, simple to use, and responsive. --- Selecting ...

Open this answer on its own page →

Normalization

2081 · 5 marks

List the advantages of Normalization. Explain 2NF with an example. [5]

Show solved answer

Advantages of Normalization and Explanation of 2NF


Advantages of Normalization

Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. Its key advantages are:

  1. Eliminates Data Redundancy: Removes duplicate data stored across multiple tables, saving storage space.
  2. Prevents Update Anomalies: Ensures that updating a single fact requires changing it in only one place.
  3. Prevents Insertion Anomalies: Allows new data to be inserted without requiring unrelated data to be present.
  4. Prevents Deletion Anomalies: Ensures that deleting a record does not unintentionally remove other important data.
  5. Improves Data Integrity and Consistency: Data remains accurate and consistent throughout the database.
  6. Easier Maintenance: A well-normalized database is easier to modify and extend.

Second Normal Form (2NF)

Definition

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

  • It is already in First Normal Form (1NF), AND
  • Every non-key attribute is fully functionally dependent on the entire primary key (i.e., there is no partial dependency on any part of a composite primary key).

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


Example

Consider the following relation with a composite primary key (StudentID, CourseID):

StudentIDCourseIDStudentNameCourseNameMarks
S01C01RamDBMS75
S01C02RamOS80
S02C01SitaDBMS70

Primary Key: (StudentID, CourseID)

Identifying Partial Dependencies:

  • StudentName depends only on StudentID (not on the full key) -- Partial Dependency
  • CourseName depends only on CourseID (not on the full key) -- Partial Dependency
  • Marks depends on both StudentID and CourseID -- Full Dependency (OK)

Since partial dependencies exist, this relation is NOT in 2NF.


Converting to 2NF

We decompose the table to remove partial dependencies:

Table 1: Student (depends on StudentID)

StudentIDStudentName
S01Ram
S02Sita

Table 2: Course (depends on CourseID)

CourseIDCourseName
C01DBMS
C02OS

Table 3: Enrollment (depends on full composite key)

StudentIDCourseIDMarks
S01C0175
S01C0280
S02C0170

Now all non-key attributes are fully functionally dependent on the entire primary key in each table. The database is now in 2NF.


Note: 2NF is only relevant when the primary key is composite. If a relation has a single-attribute primary key and is in 1NF, it is automatically in 2NF.

Open this answer on its own page →

Physical File and Database Design

2080 · 10 marks

Explain physical database design. Why is physical database design important? Differentiate logical database design with physical database design.[10]

Show solved answer

Physical Database Design

Definition

Physical database design is the process of transforming a logical database model into a physical implementation on a specific hardware and software platform. It involves decisions about how data will be physically stored, accessed, and managed in secondary storage (disks). In physical design, the logical specifications of the system are transformed into technology-specific details.

The main purpose of database design (both logical and physical) is to produce logical and physical designs of the proposed database system to meet the requirements of users and for high performance.


Key Activities in Physical Database Design

1. Designing Fields

  • A field is the smallest unit of application data recognized by system software such as a programming language or a DBMS.
  • An attribute from a logical database model may be represented by several fields.
  • A field that can be derived from other database fields is called a calculated field.
  • Some database technologies allow explicit definition of calculated fields; the system either stores the calculated value or computes it when requested.

2. Designing Physical Tables

A physical table is a named set of rows and columns that specifies fields in each row. The design of a physical table has two goals:

GoalDescription
Efficient use of secondary storageRelates to how data are loaded on disks; depends on operating system parameters
Data processing speedData are most efficiently processed when stored close to one another in secondary memory, minimizing the number of I/O operations

3. Designing Forms and Reports

  • Forms are used to collect or present information on a single item (customer, product, event); used for both input and output.
  • Reports are the product of input and output design and are purely used for reading.
  • Forms provide fields for data input; reports do not.

4. Additional Physical Design Decisions (standard CS supplement)

  • Choosing file organization (sequential, indexed, hashed)
  • Defining indexes to speed up query processing
  • Selecting storage structures and access paths
  • Partitioning and clustering of data
  • Allocating disk space and buffer management

Why is Physical Database Design Important?

Physical database design is important for the following reasons:

  1. High Performance: Proper physical design minimizes I/O operations by storing related data close together in secondary memory, resulting in faster data retrieval and processing.

  2. Efficient Storage Utilization: It ensures efficient use of secondary storage (disk space), avoiding wastage and reducing storage costs.

  3. Meeting User Requirements: The main purpose of database design is to produce a system that meets the requirements of users; physical design is the stage where this is actually implemented on real hardware.

  4. Technology-Specific Optimization: Logical design is platform-independent, but physical design transforms those specifications into technology-specific details suited to the actual DBMS and hardware being used.

  5. Scalability and Reliability: Good physical design ensures the database can handle growing data volumes and remains reliable under heavy load.

  6. Support for Application Interfaces: Physical design supports the design of forms and reports that users interact with, making the system usable and responsive.


Differentiation: Logical Database Design vs. Physical Database Design

AspectLogical Database DesignPhysical Database Design
DefinitionOrganization of data into a conceptual model independent of any hardware or softwareTransformation of the logical model into technology-specific physical storage structures
Platform DependencyIndependent of any specific hardware or software platformDependent on specific hardware, OS, and DBMS platform
FocusWhat data to store and how data relate to each otherHow and where data will be physically stored
Tools/TechniquesNormalization, E-R modeling, consolidation of user-interface data requirementsFile organization, indexing, table design, field design
OutputNormalized logical data model (tables, relationships, attributes)Physical tables, fields, indexes, storage allocations
Level of AbstractionHigh-level, abstract representationLow-level, implementation-specific representation
GoalCorrectness, consistency, and completeness of data modelEfficiency of storage and speed of data processing
ProcessDevelop normalized data model for each user interface; combine into one consolidated logical model; translate E-R modelDesign fields, physical tables, forms, reports; define indexes and access paths
ConsiderationBusiness rules, relationships, constraintsI/O operations, disk storage, buffer management
PhaseDone before physical designDone after logical design is finalized

Summary

In short, logical database design answers "What data should be stored and how are they related?" while physical database design answers "How and where will the data actually be stored on the hardware?" Both are essential phases in the database design process, and physical design is critical because it directly determines the performance, efficiency, and usability of the final database system.

Open this answer on its own page →

Interaction Methods and Devices

2080 · 5 marks

Describe several methods for interacting with the system. [5]

User interaction methods define how a user communicates with a software system to invoke operations and receive responses. The following are the main methods of interacting with a system: --- - This method requires users to remember command syntax and semantics. - The user enters explicit stateme...

Open this answer on its own page →

Designing Forms and Reports

2079 · 5 marks

Compare form with report. Explain the process of designing forms and reports. [5]

--- Basis Form Report --------- Purpose Used to collect or present information on a single item (e.g., customer, product, event) Product of input and output design; used to present summarized or detailed information Usage Can be used for both input and output Purely used for reading/output only D...

Open this answer on its own page →

Database Design

2078 · 5 marks

What is the purpose of database design? Compare logical design with physical design. [5]

Database design is the organization of data according to a database model. The main purpose of database design is to: - Produce logical and physical designs of the proposed database system - Meet the requirements of users - Ensure high performance of the database system In short, database design ...

Open this answer on its own page →

Formatting Forms and Reports

2076 · 5 marks

How do you format forms and reports? Explain general guidelines for formatting forms and reports. [5]

Forms are used to collect or present information on a single item (such as a customer, product, or event) and can be used for both input and output. Reports are purely used for reading and are the product of input and output design. Proper formatting of both is essential for usability and clarity...

Open this answer on its own page →