0% found this document useful (0 votes)
41 views

Database Development

Uploaded by

nightnarsi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Database Development

Uploaded by

nightnarsi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 36

SECTOR: ICT AND MULTIMEDIA

TRADE: SOFTWARE DEVELOPMENT


MODULE CODE AND NAME: SWDDD401 DATABASE
DEVELOPMENT
TEACHER’S NAME: IKIREZI PACIFIQUE
SCHOOL: ETP NYARUREMA TSS

Learning outcome 1: Analyze Database TOTAL HOURS


20

1.1 Description of database fundamental


A. Database
Database: An organized collection of structured information
or data, typically stored electronically in a computer system,
that can be easily accessed, managed, and updated.
B. Data
Data refers to the individual pieces of information stored
within the database. This data is organized into tables and is
used to represent and manage various types of information
C. Information

information refers to data that has been processed, organized,


or interpreted to be meaningful and useful. It is the result of
analyzing and contextualizing raw data to provide insight or
knowledge that supports decision-making and understanding.
Here’s a more detailed breakdown:
1. Data vs. Information:
o Data: Raw, unprocessed facts and figures without

context. For example, numbers, text, or dates alone


(e.g., 100, “Alice Smith”, “2024-09-10”).
o Information: Data that has been processed or

organized in a way that gives it meaning. For


example, a summary of sales figures that shows
trends or patterns, or a customer profile that
provides insights into buying behavior

D. Entities

  An entity is a fundamental component of a database


or data model that holds or represents data about a
specific subject. For example, in a university database,
entities might include Student, Course, and
Instructor.

 Entity Types:
 Strong Entity: Represents a real-world object that can
exist independently. For example, a Customer entity in
an e-commerce database is a strong entity.
 Weak Entity: Depends on another entity for its
identification. It cannot be uniquely identified by its own
attributes alone. For example, an OrderItem might be
a weak entity dependent on an Order.

 Entity Set:
 An entity set is a collection of entities of the same type.
For example, the set of all Customers in a database
forms the Customer entity s
E. Attributes/Field
An attribute is a field or column in a database table that
stores a specific piece of data about an entity. For
example, in a database for employees, attributes of the
Employee entity might include EmployeeID,
FirstName, LastName, and HireDate.
Attributes are used to store individual data items related
to an entity. Each attribute holds a particular type of data,
such as text, numbers, or dates.

Attribute Types:
 Simple Attribute: An attribute that cannot be divided
further. For example, FirstName or DateOfBirth.
 Composite Attribute: An attribute that can be divided
into smaller sub-parts, each representing a more basic
attribute. For example, a FullName attribute might be
divided into FirstName and LastName.
 Derived Attribute: An attribute whose value is derived
from other attributes. For example, an Age attribute can
be derived from the DateOfBirth attribute.
 Multi-Valued Attribute: An attribute that can hold
multiple values. For example, PhoneNumbers for a
contact might include multiple phone numbers
F. Records
A record is a collection of related data fields that together
represent a specific instance of an entity. In a table, each
record is typically stored in a separate row
Example:
Consider a Students table in a school database. A record in
this table might look like this:
lua
Copy code
| StudentID | FirstName | LastName |
DateOfBirth |
|-----------|-----------|----------|--
-----------|
| 001 | John | Doe |
2004-05-15 |

In this example, the entire row represents one student


record, with values for StudentID, FirstName,
LastName, and DateOfBirth.

g. Table

Table is a fundamental data structure that organizes data


into rows and columns. It is essentially a collection of related
records (or rows) that share the same structure, with each
record consisting of multiple fields (or columns). Tables are
used to store and manage data in a structured format,
allowing for efficient data retrieval, manipulation, and
analysis

A table is a collection of data organized in rows and columns


within a database. Each table represents a specific entity or
concept (e.g., Customers, Orders, Products).

 Columns (Fields): Each column in a table represents an


attribute or property of the entity. Columns are defined with a
specific data type and may have constraints. For example, a
Customer table might have columns like CustomerID,
Name, Email, and PhoneNumber.

 Rows (Records): Each row in a table represents a single


instance or record of the entity. A row contains values for
each column in the table. For example, one row in the
Customer table might represent a single customer with their
respective details.
h. Database schema
 Schema:
 The schema of a table defines its structure, including the
column names, data types, and constraints. The schema
outlines how data is organized and what kind of data can
be stored in each column.
 Primary Key:
 Most tables have a primary key, which is a column (or a
set of columns) that uniquely identifies each row in the
table. For example, CustomerID might be the primary
key in the Customer table.

 Foreign Key:
 Tables can have foreign keys, which are columns that
establish relationships with primary keys in other tables.
For example, an Order table might have a
CustomerID foreign key that links to the
CustomerID primary key in the Customer table.

 Definition:A database schema is a formal representation of


the database structure. It describes the design and organization
of the database, including its tables, columns, relationships,
indexes, and constraints.
 Components:
 Tables: Defines the entities in the database, with their
corresponding columns (fields) and data types.
 Columns (Fields): Specifies the attributes of each table,
including their names and data types.
 Data Types: Defines the type of data each column can
hold, such as INTEGER, VARCHAR, DATE, etc.
 Primary Keys: Specifies the unique identifier for each
row in a table. Ensures that each record can be uniquely
identified.
 Foreign Keys: Defines relationships between tables by
linking columns in one table to primary keys in another
table. Establishes referential integrity.
 Indexes: Defines the indexes created on tables to
improve query performance.
 Constraints: Defines rules that enforce data integrity
and consistency, such as NOT NULL, UNIQUE, CHECK,
and DEFAULT constraints.

 Types of Schemas:
 Logical Schema: Focuses on the logical structure of the
database, including tables, columns, and relationships,
without concern for how data is physically stored.
 Physical Schema: Details the physical storage of data,
including how data is stored on disk, indexing methods,
and performance optimizations.
 Conceptual Schema: Provides a high-level view of the
database, describing the overall structure and
relationships between entities without getting into
implementation details
 i. DBMS
A Database Management System (DBMS) is software
designed to manage, organize, and control access to
databases. It provides an interface for users and
applications to interact with data, ensuring efficient
storage, retrieval, and manipulation

 Applications of database

Databases are integral to modern technology and businesses.


They are used in a wide range of applications across various
industries to store, manage, and retrieve data efficiently. Here
are some common applications of databases:
1. Business and Enterprise Applications
 Customer Relationship Management (CRM):
Manages customer data, sales, and interactions to
enhance customer service and sales efforts (e.g.,
Salesforce, HubSpot).
 Enterprise Resource Planning (ERP): Integrates core
business processes such as finance, HR, and supply chain
management into a unified system (e.g., SAP, Oracle
ERP).
 Inventory Management: Tracks inventory levels,
orders, sales, and deliveries to optimize supply chain
operations.
2. Finance and Banking
 Transaction Processing: Manages and records financial
transactions, including deposits, withdrawals, and
transfers.
 Risk Management: Analyzes financial risk and manages
investment portfolios.
 Fraud Detection: Monitors transactions and identifies
suspicious activities to prevent fraud.
3. Healthcare
 Electronic Health Records (EHR): Stores patient
records, including medical history, treatments, and
diagnoses.
 Appointment Scheduling: Manages patient
appointments, schedules, and follow-ups.
 Pharmacy Management: Tracks prescriptions,
inventory, and patient medication histories.
4. Education
 Student Information Systems: Manages student data,
grades, attendance, and enrollment.
 Learning Management Systems (LMS): Stores course
materials, assignments, and student progress (e.g.,
Moodle, Blackboard).
5. E-Commerce
 Product Catalogs: Manages product information,
pricing, and availability.
 Order Processing: Handles customer orders, payments,
and shipping.
 Customer Accounts: Stores user profiles, purchase
history, and preferences.
6. Telecommunications
 Call Detail Records: Tracks call activities, durations,
and billing information.
 Network Management: Monitors and manages network
performance, configurations, and usage.
7. Social Media
 User Profiles: Stores user information, posts, and
interactions.
 Content Management: Manages media content,
including images, videos, and articles.
 Analytics: Analyzes user engagement, trends, and
network growth.
8. Government and Public Sector
 Citizen Records: Manages data related to citizens,
including identification, voting, and tax records.
 Public Services: Supports systems for utilities,
transportation, and emergency services.
9. Travel and Hospitality
 Reservation Systems: Manages bookings for airlines,
hotels, and car rentals.
 Customer Profiles: Stores traveler preferences, frequent
flyer information, and loyalty programs.
10. Research and Science
 Data Repositories: Stores research data, experimental
results, and scientific observations.
 Collaborative Platforms: Supports data sharing and
collaboration among researchers and institutions.
11. Media and Entertainment
 Content Libraries: Manages digital assets such as
movies, music, and games.
 User Preferences: Stores user activity, ratings, and
recommendations for personalized content delivery.
12. Utilities and Energy
 Grid Management: Monitors and manages energy
distribution and consumption.
 Maintenance Scheduling: Tracks equipment
maintenance, repairs, and upgrades.
13. Transportation and Logistics
 Fleet Management: Tracks vehicle locations,
maintenance, and routes.
 Supply Chain Management: Manages the flow of
goods from suppliers to customers, including inventory
and shipping.
Benefits of Using Databases in These Applications:
 Efficiency: Streamlines data management tasks, reducing
manual effort and errors.
 Data Integrity: Ensures accuracy and consistency
through constraints and rules.
 Security: Protects sensitive data through access controls
and encryption.
 Scalability: Handles large volumes of data and users
efficiently.
 Accessibility: Provides easy access to data for authorized
users and applications.

 Advantages and Disadvantages of Database

Databases offer numerous advantages and can also present


certain disadvantages depending on how they are
implemented and managed. Here’s a detailed look at both:
Advantages of Databases
1. Efficient Data Management:
o Centralized Data: Consolidates data in one

location, reducing redundancy and ensuring


consistency.
o Data Retrieval: Provides powerful querying

capabilities to quickly retrieve and manipulate data.


2. Data Integrity and Accuracy:
o Constraints: Enforces rules like primary keys,

foreign keys, and unique constraints to maintain


data accuracy and prevent errors.
o Normalization: Organizes data to minimize

redundancy and dependency, improving data


integrity.
3. Data Security:
o Access Controls: Restricts access to data through

user authentication and authorization mechanisms.


o Encryption: Protects data from unauthorized access

both at rest and in transit.


4. Transaction Management:
o ACID Properties: Ensures that transactions are

processed reliably, maintaining data consistency


even in case of system failures.
5. Scalability:
o Handling Large Volumes: Designed to efficiently

handle large amounts of data and a high number of


concurrent users.
o Flexibility: Can be scaled vertically (by upgrading
hardware) or horizontally (by adding more servers).
6. Backup and Recovery:
o Automated Backups: Supports regular backups to

protect against data loss.


o Recovery Tools: Provides tools for recovering data

in case of hardware failure, corruption, or other


issues.
7. Data Independence:
o Logical and Physical Independence: Allows

changes to the database schema without affecting


applications that use the data.
8. Improved Productivity:
o Data Sharing: Enables multiple users and

applications to access and share data


simultaneously.
o Reduced Redundancy: Minimizes duplicate data

entry and storage.


Disadvantages of Databases
1. Complexity:
o Design and Implementation: Requires careful

planning and design, which can be complex and


time-consuming.
o Maintenance: Ongoing maintenance, such as

schema updates and performance tuning, can be


complex.
2. Cost:
o Initial Setup: Can be expensive to set up, including

costs for software, hardware, and licensing.


o Operational Costs: Ongoing costs for maintenance,

backups, and administration can be high.


3. Performance Issues:
oQuery Performance: Poorly optimized queries and
indexes can lead to slow performance.
o Scalability Challenges: While databases can scale,

doing so effectively requires careful planning and


management.
4. Security Risks:
o Vulnerabilities: Databases can be targets for

security breaches if not properly secured.


o Access Control Complexity: Managing and

enforcing security policies can be complex.


5. Data Migration:
o Compatibility Issues: Migrating data between

different systems or upgrading database versions


can be challenging and require careful handling.
6. Data Corruption:
o Hardware Failures: Data can become corrupted

due to hardware failures or software bugs, despite


backup systems.
o User Errors: Incorrect data entry or deletion can

lead to data loss or inconsistencies.


7. Dependency on Database Administrators:
o Specialized Knowledge: Requires skilled database

administrators (DBAs) to manage and maintain the


system effectively.
8. Overhead:
o Resource Usage: Databases can consume

significant system resources (e.g., memory, CPU)


which can affect overall system performance.
Summary
Advantages:
 Efficient data management and retrieval
 Data integrity and accuracy
 Enhanced security
 Reliable transaction management
 Scalability and flexibility
 Backup and recovery capabilities
 Data independence
 Improved productivity and data sharing
Disadvantages:
 Complexity in design and maintenance
 High initial and operational costs
 Potential performance issues
 Security risks and management challenges
 Data migration difficulties
 Risk of data corruption
 Dependence on specialized DBAs
 Resource overhead
 Identification of database models
Identifying and understanding different database models is
crucial for choosing the right system to meet specific needs.
Each model has its own structure, advantages, and use cases.
Here’s a detailed overview of the primary database models:
1. Relational Database Model (RDBMS)
 Structure: Data is organized into tables (relations) with
rows and columns. Each table has a schema that defines
its structure.
 Relationships: Tables can be related to each other
through foreign keys.
 Query Language: Uses SQL (Structured Query
Language) for querying and manipulating data.
 Examples: MySQL, PostgreSQL, Oracle Database,
Microsoft SQL Server.
 Use Cases: Traditional business applications, financial
systems, CRM systems, and inventory management.
2. Hierarchical Database Model
 Structure: Data is organized in a tree-like structure
where each record has a parent-child relationship. Each
parent can have multiple children, but each child has
only one parent.
 Examples: IBM Information Management System
(IMS), Windows Registry.
 Use Cases: Early database systems, organizational
charts, and file systems.
3. Network Database Model
 Structure: Data is represented as a network of nodes and
connections, allowing more complex many-to-many
relationships compared to the hierarchical model.
 Examples: Integrated Data Store (IDS), IDMS
(Integrated Data Management System).
 Use Cases: Complex applications where relationships
between records are more intricate, such as
telecommunications and logistics.
4. Object-Oriented Database Model (OODBMS)
 Structure: Stores data as objects, similar to object-
oriented programming languages. Each object contains
both data and methods to operate on the data.
 Examples: ObjectDB, db4o.
 Use Cases: Applications requiring complex data
representations, such as CAD/CAM Summary
Relational Databases (RDBMS):
 Advantages: Structured data, strong consistency,
extensive querying capabilities with SQL.
 Use Cases: Enterprise applications, transaction systems.
Hierarchical and Network Databases:
 Hierarchical: Simple parent-child relationships, used in
older systems.
 Network: More flexible relationships, used in complex
scenarios.
Object-Oriented Databases:
 Advantages: Aligns with object-oriented programming,
supports complex data types.
 Use Cases: Complex applications needing detailed data
representations.
 Identification of database Relationship

One to one

A one-to-one relationship in a database refers to a scenario


where each record in Table A is associated with exactly one
record in Table B, and each record in Table B is associated
with exactly one record in Table A. This type of relationship
ensures a one-to-one correspondence between the records
in the two tables
Example
Consider an example where you have a database with two
tables: Person and Passport. Each person is issued
exactly one passport, and each passport belongs to exactly one
person.
One to many
A one-to-many (1:M) relationship in a database refers to a
scenario where a single record in one table (the "one" side)
can be associated with multiple records in another table (the
"many" side), but each record in the "many" table is related to
only one record in the "one" table. This type of relationship is
one of the most common in relational databases
Example
Consider a database with two tables: Department and
Employee. Each department can have multiple employees,
but each employee belongs to only one department.
Many to one
A many-to-one (M:1) relationship in a database is essentially
the inverse of a one-to-many (1
) relationship. In this type of relationship, multiple records in
one table (the "many" side) can be associated with a single
record in another table (the "one" side). Despite the different
terminology, many-to-one and one-to-many relationships
describe the same underlying association but from different
perspectives.
Example
Consider a database with two tables: Employee and
Department. In this case, many employees belong to one
department, but each employee is associated with only one
department
Many to many
A many-to-many (M:M) relationship in a database is a
scenario where multiple records in one table (the "many" side)
can be associated with multiple records in another table (also
the "many" side). This type of relationship is used to represent
complex associations between entities where each entity in
one table can relate to multiple entities in the other table

Example
Consider a database with two tables: Student and Course.
Students can enroll in multiple courses, and each course can
have multiple students enrolled
 Determination of data types
Determining data types is a crucial part of database design, as
it ensures that the data is stored efficiently, accurately, and
can be manipulated effectively. Here’s a detailed explanation
of how to determine the most common data types in
databases: Character, Number, and Date.
1. Character Data Type
Character data types are used to store text-based data, such as
names, addresses, or descriptions. The length of the text can
vary, and databases provide different character data types
based on the length and nature of the text.
Common Character Data Types:
 CHAR(n): Fixed-length character type. Always stores a
specified number of characters (n). If the input is shorter
than n, it is padded with spaces.
o Example: CHAR(10) stores exactly 10 characters.
o Use case: Storing fixed-length codes like postal

codes.
 VARCHAR(n): Variable-length character type. Only
stores the characters provided up to a maximum limit of
n.
o Example: VARCHAR(50) stores up to 50 characters.

o Use case: Storing names, addresses, or other

variable-length text.
 TEXT: Stores large text data with no predefined length
limit. Ideal for storing paragraphs or lengthy
descriptions.
o Example: TEXT is used for storing articles or blog

posts.
How to Determine Character Data Type:
 Use CHAR if the length of the text is fixed.
 Use VARCHAR if the text length varies but has a
known maximum.
 Use TEXT for large, unrestricted text fields.

2. Number Data Type


Number data types are used for storing numeric values, such
as quantities, prices, or measurements. They can be used for
both integers and floating-point numbers.
Common Number Data Types:
 INTEGER (INT): Stores whole numbers without any
decimal points.
o Example: INT is used for counting items or storing

IDs.
 DECIMAL(p, s) or NUMERIC(p, s): Stores fixed-point
numbers with precision p (total digits) and scale s (digits
after the decimal point).
o Example: DECIMAL(10, 2) stores numbers with up

to 10 digits, 2 of which are after the decimal point.


o Use case: Storing currency values like prices.

 FLOAT or REAL: Stores floating-point numbers


(approximate values).
o Example: FLOAT is used for scientific calculations

requiring decimal numbers.


o Note: FLOAT may introduce rounding errors due

to precision limitations, so it is often avoided for


financial data.
How to Determine Number Data Type:
 Use INTEGER for whole numbers.
 Use DECIMAL or NUMERIC for precise decimal
values, especially in financial applications.
 Use FLOAT for approximate decimal values where
precision is less critical.
3. Date Data Type
Date data types store dates, times, or timestamps. These are
essential for tracking events, recording transactions, or
scheduling.
Common Date Data Types:
 DATE: Stores only the date (year, month, day).
o Example: DATE for birthdates or registration dates.

 TIME: Stores only the time (hours, minutes, seconds).


o Example: TIME for recording specific times of

events.
 DATETIME or TIMESTAMP: Stores both date and
time.
o Example: DATETIME for tracking events with a

precise timestamp.
 INTERVAL: Represents a span of time, such as "3
days" or "2 hours".
How to Determine Date Data Type:
 Use DATE if only the date is needed.
 Use TIME if only the time component is required.
 Use DATETIME or TIMESTAMP if both date and
time are needed.
 Use INTERVAL for storing durations or time
differences.

Summary Table
Data Type Example Use Case Example Value
CHAR Postal code, '12345'
country code
VARCHAR Names, email '[email protected]'
addresses
TEXT Article content, 'Lorem ipsum...'
blog posts
INTEGER Counting items, 12345
user IDs
DECIMAL Currency, financial 999.99
amounts
FLOAT Scientific 3.14159
measurements
DATE Birthdate, contract '2024-11-11'
date
TIME Appointment time '14:30:00'
DATETIM Timestamp for logs '2024-11-11 14:30:00'
E
INTERVAL Time duration '3 days'
Understanding and choosing the correct data type ensures
efficient storage and accurate data manipulation in your
database.
Data Dictionary: Definition and Elements
1. Definition of a Data Dictionary
A data dictionary is a centralized repository that contains
detailed information (metadata) about the data within a
database or information system. It describes the structure,
types, constraints, relationships, and meanings of the data
elements stored in the system. Essentially, it's like a reference
manual that documents the data assets of an organization.
A data dictionary provides:
 A consistent understanding of data elements across the
organization.
 Improved data management by providing clear documentation
of what each data element represents.
 Easier data governance, making it simpler to maintain and
manage data standards.
 A single source of truth for developers, analysts, and other
stakeholders to ensure consistent usage of data fields.

2. Elements of a Data Dictionary


The data dictionary typically includes a range of metadata
elements to describe each data entity or field in a database.
Here are some of the key components:
A. Data Element Name
 The unique name or identifier of the data field.
 Example: customer_id, order_date.

B. Data Type
 Specifies the type of data stored (e.g., INTEGER, VARCHAR,
DATE).
 Example: customer_name is VARCHAR(50), order_amount is
DECIMAL(10, 2).

C. Data Length
 Defines the maximum size of the data element.
 Example: phone_number has a length of 10 characters.

D. Description
 A brief explanation of the data element's purpose or meaning.
 Example: order_status indicates whether an order is
"Pending", "Shipped", or "Cancelled".

E. Default Value
 The value automatically assigned to the field if no value is
provided.
 Example: status defaults to "Active".

F. Constraints and Rules


 Validation rules or conditions applied to the data field.
 Examples:
o Primary Key: Ensures each record has a unique identifier.
o Foreign Key: Links the field to another table for
relationships.
o Not Null: Ensures the field cannot be left empty.
o Unique: Ensures all values are distinct.
o Check: Adds a condition like age > 18.

G. Allowed Values (Domain)


 Specifies a list of acceptable values for the data element.
 Example: gender can only be "Male", "Female", or "Non-
binary".

H. Relationships
 Defines associations between data elements or tables (one-to-
one, one-to-many, many-to-many).
 Example: customer_id in the Orders table is linked to the
Customers table.

I. Source
 Indicates the origin of the data element (e.g., user input,
automated system, external source).
 Example: sales_data imported from an external system.

J. Owner or Steward
 Identifies the person or department responsible for
maintaining the data element.
 Example: The finance team manages the invoice_amount
field.

K. Last Updated
 Timestamp indicating when the data element definition was
last modified.
 Example: last_updated = '2024-11-10'.
Example of a Data Dictionary Entry
Attribute Description
Name employee_id
Data Type INTEGER
Length 10
Description Unique identifier for each employee
Default Value None
Constraints Primary Key, Not Null
Allowed Positive integers only
Values
Relationships Linked to employee_department table
Source Internal HR system
Owner HR Department
Last Updated 2024-11-11

Benefits of Using a Data Dictionary


 Consistency: Provides a single source of truth for data
definitions.
 Improved Data Quality: Helps in validating data inputs and
maintaining data integrity.
 Efficient Communication: Facilitates better collaboration
among developers, analysts, and business users.
 Compliance and Auditing: Ensures adherence to data
governance and regulatory standards.

A well-maintained data dictionary is a critical tool in data


management and governance, ensuring that data is used
correctly and effectively throughout an organization.
Identification of Database Requirements

When designing a database, it's crucial to identify and define


its requirements to ensure it meets the organization's needs
effectively. Database requirements are typically categorized
into Functional Requirements and Non-Functional
Requirements.
1. Functional Requirements
Functional requirements define what the database system
must do to support the organization's operations. These are
specific tasks, operations, or services that the database should
be able to perform. Functional requirements are directly
related to the business processes and the data management
needs of the organization.
Examples of Functional Requirements:

 Data Storage and Retrieval:


o The database must store information about customers,
orders, products, and invoices.
o The system should allow users to retrieve customer
profiles using a customer ID.

 Data Manipulation:
o Users should be able to add, update, and delete records
in the database (e.g., updating a customer's address).
o The system should support searching and filtering data
(e.g., finding all orders placed in the last month).

 Data Integrity and Validation:


o The database must ensure that no duplicate customer
records are created.
o Implement data validation rules to prevent invalid data
entries (e.g., ensuring phone numbers are 10 digits).

 Reports and Analytics:


o The system should generate monthly sales reports and
provide insights into inventory levels.
o Allow users to generate custom queries for analysis.

 Access Control and Security:


o Only authorized users should be able to access sensitive
data, such as employee salaries.
o Support role-based access control to restrict database
operations based on user roles.

 Data Backup and Recovery:


o The system must perform automated daily backups of the
database.
o Support data recovery in case of system failure or data
corruption.

2. Non-Functional Requirements
Non-functional requirements specify how the database system
should operate rather than what it should do. These
requirements focus on the performance, usability, reliability,
and other quality attributes of the database.
Types of Non-Functional Requirements:
Non-Functional
Description
Requirement
The database should handle up to 10,000
Performance transactions per second with a response time of
less than 1 second.
The system must be able to scale to
Scalability accommodate 1 million records without
degradation in performance.
The database should have 99.9% uptime,
Availability
ensuring minimal downtime.
Non-Functional
Description
Requirement
Implement encryption for data at rest and in
Security
transit to protect sensitive information.
The database interface should be intuitive,
Usability allowing users to easily perform CRUD (Create,
Read, Update, Delete) operations.
The database structure should be easy to
Maintainability modify to support future changes in business
requirements.
The database must enforce data consistency,
Data Consistency
especially in a distributed environment.
The system must comply with industry
Compliance
regulations such as GDPR for data privacy.
Ensure automated backups occur every 24
Backup and
hours, and recovery should take less than 30
Recovery
minutes.

Examples of Non-Functional Requirements:


1. Performance:
o Queries on the Orders table must return results within 2
seconds for 90% of all requests.

2. Scalability:
o The database should scale horizontally to handle
increased loads as the business grows.

3. Reliability:
o The system should be resilient to failures, with automatic
failover to a backup database.
4. Data Security:
o Implement two-factor authentication for database
administrators.
o All personal data should be encrypted using AES-256
encryption.

5. Compliance:
o The database must be GDPR compliant, ensuring users
can request data deletion.

6. Usability:
o The user interface should allow non-technical users to
easily generate standard reports without writing SQL
queries.

Summary Table
Requirement
Example Focus Area
Type
Storing customer information, What the database
Functional
generating reports does
Ensuring high performance, How the database
Non-Functional
security, scalability operates

Why Identifying Database Requirements is Important


 Ensures Alignment: Ensures that the database meets both the
business and technical needs of the organization.
 Prevents Issues: Helps in identifying potential problems early in
the design phase.
 Improves Efficiency: Leads to the development of an efficient
and effective database system that supports organizational
growth.
 Facilitates Maintenance: Makes future changes and
optimizations easier to implement.

Carefully identifying and addressing both functional and non-


functional requirements is crucial for the successful design,
implementation, and operation of a database system.
Methods to Collect Data
When building a database or information system, gathering
accurate and relevant data is critical. Different methods can be
used to collect data to ensure the database is tailored to meet
specific needs. Let's explore the four common data collection
methods: Interviews, Documentation, Questionnaires, and
Observation.

1. Interview
An interview is a direct, face-to-face or virtual conversation
between an interviewer and an interviewee to gather in-depth
information. It is one of the most effective methods to collect
qualitative data.
How It Works:

 A series of questions are prepared to explore specific topics


related to the system requirements or data needs.
 Interviews can be structured (pre-defined questions), semi-
structured (open-ended questions with some flexibility), or
unstructured (a free-form conversation).

Advantages:

 Allows for clarification of responses and follow-up questions


for deeper insights.
 Provides detailed information and context about user needs,
preferences, and challenges.
 Useful for identifying implicit requirements that users may not
initially express.

Disadvantages:

 Time-consuming and can be labor-intensive to conduct and


analyze.
 Subject to bias depending on how questions are asked and
interpreted.
 Requires skilled interviewers to effectively gather and interpret
responses.

Use Cases:

 Gathering requirements from stakeholders for a new database


system.
 Understanding the challenges users face with an existing
system.
 Collecting expert opinions or feedback on system functionality.

2. Documentation
Documentation refers to reviewing existing documents,
records, and files related to the system or business processes.
It is a passive method of data collection that involves
analyzing written or digital resources.
How It Works:

 Examine documents such as business reports, manuals,


policies, transaction logs, and existing databases.
 Look for patterns, data structures, existing workflows, and
historical data to understand the current system.
Advantages:

 Provides a comprehensive historical view of the organization’s


processes.
 Can reveal existing data structures, saving time during
database design.
 Non-intrusive, as it does not require the involvement of users
or stakeholders.

Disadvantages:

 Documents may be outdated or incomplete, leading to


incorrect conclusions.
 Interpretation of documents can be subjective without context.
 May not capture the latest changes or real-time challenges in
the organization.

Use Cases:

 Understanding existing workflows and data structures before


system redesign.
 Analyzing policies for compliance requirements in a new
database.
 Verifying transaction records to understand historical data
trends.

3. Questionnaire
A questionnaire is a set of pre-defined questions distributed
to a large group of people to collect standardized data. It is
usually used for gathering quantitative data but can also
include open-ended questions for qualitative insights.
How It Works:

 Design a questionnaire with a mix of closed (yes/no, multiple-


choice) and open-ended questions.
 Distribute via online platforms, email, or printed forms to the
target audience.
 Responses are collected, analyzed, and used to inform the
database design.

Advantages:

 Efficient for reaching a large number of respondents quickly.


 Data can be easily quantified and analyzed for trends and
patterns.
 Cost-effective, especially when conducted online.

Disadvantages:

 Low response rates can affect the reliability of the results.


 Responses may be superficial without opportunities for follow-
up questions.
 Can result in misinterpretation if questions are not clear or
well-structured.

Use Cases:

 Gathering user feedback on existing database systems.


 Collecting requirements from a dispersed group of
stakeholders.
 Conducting surveys to understand user needs for a new
system.

4. Observation
Observation involves watching users interact with systems or
perform tasks in their natural environment to understand their
behavior and identify potential data requirements. It is
particularly useful for understanding workflows that users
may not articulate clearly.
How It Works:
 Observers watch users as they perform tasks, noting their
actions, difficulties, and how they use existing systems.
 Observations can be structured (predefined aspects to observe)
or unstructured (general observation).

Advantages:
 Provides real-world insights into how users interact with
systems.
 Can identify inefficiencies or pain points that users may not be
aware of.
 Useful for validating or supplementing data collected from
interviews or questionnaires.

Disadvantages:
 Observations can be time-consuming and resource-intensive.
 Users may behave differently when they know they are being
observed (Hawthorne Effect).
 Interpretation of observations can be subjective and requires
experience.

Use Cases:
 Observing how employees enter data into existing systems to
identify inefficiencies.
 Understanding real-time challenges in a workflow for better
database design.
 Validating data collected through interviews or surveys.
Comparison Table
Method Type of Data Advanta Disadvant Best Used
Collected ges ages For
Interview Qualitative In- Time- Understan
depth, consuming ding
flexible, , potential detailed
interacti bias user needs
ve
Documenta Existing records Historica May be Analyzing
tion l view, outdated, existing
non- lacks systems
intrusive context
Questionna Quantitative/ Scalable, Low Gathering
ire Qualitative quick, response input from
cost- rates, large
effective superficial groups
Observatio Qualitative Real- Time- Understan
n world consuming ding user
insights, , observer interaction
behavior bias
-focused

Conclusion
Each data collection method has its strengths and weaknesses,
and the choice of method often depends on the project’s
objectives, available resources, and the nature of the data
being sought. In practice, a combination of methods is often
used to get a comprehensive view and validate findings,
ensuring a well-rounded understanding of database
requirements.

You might also like