Docsity

COMPUTERIZED DATABASE SYSTEMS, Lecture notes of Database Management Systems (DBMS)

Toggle sidebar
bg1
UNIT TITLE: COMPUTERIZED DATABASE SYSTEMS
ISCED UNIT CODE: 0612 451 08A
TVET CDACC UNIT CODE: IT/CU/ICTA/CR/03/5/MA
Duration of Unit: 200 Hours
Relationship to Occupational Standards:
This unit addresses the unit of competency: Manage Computerized Database Systems
Unit Description:
This unit covers the competencies required to manage computerized database systems. It
involves designing computerized database, creating computerized database, manipulating
computerized database, testing computerized database, and maintaining computerized
database.
Summary of Learning Outcomes:
Learning Outcome Durations (Hours)
Design computerized database. 30
Create a computerized database. 60
Manipulate computerized database. 60
Test computerized database. 30
Maintain computerized database. 20
Total Hours 200
Learning Outcomes, Content, and Suggested Assessment Methods:
Learning Outcome Content Suggested Assessment
1. Design Process of designing a Design a database schema based
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37

Partial preview of the text

Download COMPUTERIZED DATABASE SYSTEMS and more Lecture notes Database Management Systems (DBMS) in PDF only on Docsity!

UNIT TITLE: COMPUTERIZED DATABASE SYSTEMS

ISCED UNIT CODE: 0612 451 08A

TVET CDACC UNIT CODE: IT/CU/ICTA/CR/03/5/MA

Duration of Unit: 200 Hours Relationship to Occupational Standards:  This unit addresses the unit of competency: Manage Computerized Database Systems Unit Description:  This unit covers the competencies required to manage computerized database systems. It involves designing computerized database, creating computerized database, manipulating computerized database, testing computerized database, and maintaining computerized database. Summary of Learning Outcomes: Learning Outcome Durations (Hours) Design computerized database. 30 Create a computerized database. 60 Manipulate computerized database. 60 Test computerized database. 30 Maintain computerized database. 20 Total Hours 200 Learning Outcomes, Content, and Suggested Assessment Methods: Learning Outcome Content Suggested Assessment

  1. Design Process of designing a Design a database schema based

computerized database. computerized database, database modeling, normalization. on given requirements.

  1. Create a computerized database. Tools and techniques for creating a database, SQL commands for database creation. Create a database using a given set of requirements.
  2. Manipulate computerized database. Operations on database, CRUD operations, SQL commands for data manipulation. Perform CRUD operations on a given database.
  3. Test computerized database. Techniques for testing a database, testing frameworks, unit testing. Test a given database for functionality and performance.
  4. Maintain computerized database. Database maintenance, backup and recovery, security measures. Perform database maintenance tasks, including backup, recovery, and security checks. TOPIC 1: DESIGN COMPUTERIZED DATABASE 1.1: ESTABLISHING COMPUTERIZED DATABASE REQUIREMENTS Introduction to the Database Management System (DBMS) Environment Formal Definition of Terms  Database Management System (DBMS): A comprehensive suite of software programs that acts as an intermediary interface between physical database files stored on hardware media and the application programs or users accessing them. It controls all data access, security, concurrency, and integrity checking.  Data: Raw, unorganized, unprocessed, and discrete facts, observations, figures, or symbols lacking explicit operational context (e.g., a standalone value of 10026).
  1. Data Integrity Enforcement: The system automatically checks and enforces metadata constraints. It ensures data matches specified formats, falls within acceptable domain boundaries, and maintains valid primary-foreign key linkages.
  2. Data Security Management: Enforces structural security profiles using Role-Based Access Control (RBAC). It handles user login authentication, tracks data audits, and executes runtime data encryption (both at rest and in transit) to prevent unauthorized viewing.
  3. Multi-User Concurrency Control: Uses strict transaction locking mechanisms (e.g., Two- Phase Locking - 2PL) to allow hundreds of users to update the database at the exact same time without overwriting each other's changes or creating dirty reads.
  4. Backup and Recovery Management: Runs automated backup routines and maintains a continuous transaction write-ahead log (WAL). If a system crash or power outage happens, the engine uses this log to roll back broken transactions and roll forward completed ones.
  5. Data Manipulation Interface: Provides developers and tools with standard access ports (like APIs, JDBC/ODBC drivers, and SQL command consoles) to run operations on the data layer. Enterprise Database Applications  Enterprise Resource Planning (ERP): Monolithic corporate databases that connect supply chain logistics, manufacturing, asset management, human resources, and financial ledgers into a single source of truth (e.g., SAP, Oracle ERP Cloud).  Customer Relationship Management (CRM): Operational tracking systems containing client interaction metrics, automated sales funnels, marketing lists, and customer service ticket historical data (e.g., Salesforce, Microsoft Dynamics 365).

 Inventory Management Systems (IMS): Real-time tracking of physical item locations, warehouse stock counts, supply orders, and automated barcode or RFID tag updates.  Health Information Systems (HIS): Highly secure databases that track electronic medical records (EMR), laboratory results, radiology scheduling, and diagnostic codes while complying with privacy regulations.  Education Management Systems (EMS): School systems that manage student admission data, course registration limits, timetable scheduling, assignment grades, and graduation audits. DBMS Data Structural Models  Relational Database Management Systems (RDBMS): Structures data using predicate logic and set theory into two-dimensional tables (relations) made of rows (tuples) and columns (attributes). Data relationships are formed strictly through shared values across tables (e.g., MySQL, PostgreSQL, Microsoft SQL Server).  Non-Relational (NoSQL) Systems: Built to handle unstructured or semi-structured big data, prioritizing horizontal scaling over rigid schemas: o Document Stores: Data is stored as JSON or BSON documents, letting fields vary from row to row (e.g., MongoDB). o Key-Value Stores: Simple, ultra-fast hash maps designed for memory caching (e.g., Redis). o Wide-Column Stores: High-performance tabular layouts optimized for querying large numbers of rows across a few columns (e.g., Apache Cassandra). o Graph Databases: Maps entities as circles (nodes) and their connections as lines (edges), making it ideal for tracking social networks or fraud patterns (e.g., Neo4j).  Object-Oriented Database Management Systems (ODBMS): Stores data directly as application programming objects (combining data values and code methods together).

o Application Developers: Engineers who write program code to query the database. o End-Users: The consumers who view reports or enter data through front-end interfaces. Detailed Database Architectural Frameworks [Monolithic System] ➡️ [2-Tier Client-Server] ➡️ [3-Tier / N-Tier Architecture] ➡️ [Cloud Distributed]  Monolithic Architecture: A single, isolated machine houses the user interface, business application logic, and the database engine. This design is highly restricted by the processing power of that single computer.  Client-Server (2-Tier) Architecture: The architecture is split across a local area network. The client computer handles the presentation screen and runs business rules, then sends SQL queries directly across the network to the server computer, which runs the DBMS engine.  N-Tier (Multi-Tier) Architecture: A layered approach designed for secure web deployments: o Presentation Tier (Client): The web browser interface that displays screens to the user without touching the database directly. o Application Tier (Middle Middleware): Web servers running languages like Java or Python. This layer receives web requests, processes business logic, strips out malicious inputs, and passes clean queries to the database. o Data Tier (Backend): The standalone database server dedicated entirely to running the DBMS engine and writing data to disk.  Cloud Distributed Architecture: A modern setup where data is automatically sliced up, copied, and spread across multiple globally linked server data centers. It uses consensus protocols to maintain data accuracy and prevent downtime if a data center goes offline (e.g., Amazon Aurora, Google Cloud Spanner).

Database Requirements Gathering Techniques Deep Analysis of Requirement Elicitation Methods  Structured and Unstructured Interviews: o Mechanism: Face-to-face or virtual deep-dive questioning sessions conducted with operational clerks, department heads, and executives. o Teacher Guidance: Teach students that interviews help identify unwritten business rules but take significant time. Unstructured interviews encourage open discussion, while structured interviews keep the focus on specific data inputs and outputs.  Surveys and Questionnaires: o Mechanism: Mass distribution of written or digital forms containing closed-ended and open-ended questions targeting system end-users. o Application: Best for gathering statistical data about how often specific reports are run, common system pain points, and feature requests from hundreds of staff members spread across different branches.  Focus Groups: o Mechanism: Facilitated workshops with 6 to 12 representative stakeholders to openly discuss workflow requirements. o Purpose: Highly effective for highlighting and resolving conflicting process requirements between different departments before the database design begins.  Direct Job Observation: o Mechanism: The systems analyst physically sits next to users during their shifts to take detailed notes on how they handle data daily. o Value: uncovers informal workarounds, manual data habits, and hidden system interactions that workers often forget to mention during formal interviews.

and set theory. Organizes data into interrelated tables using keys. mathematical consistency, highly flexible querying via standardized declarative SQL, robust data independence. horizontally requires complex sharding configurations; handling un- structured text data introduces severe performance overhead. 3 Hierarchical Model Rigid tree structure where parent records branch down to child records. Rapid, highly efficient data retrieval when navigating down pre-defined pathways. Inflexible; cannot support Many-to- Many configurations; structural updates require rewriting data navigation code. 4 Network Model Graph-like record sets where child records can have links to multiple parent records. Handles complex interconnected business structures efficiently; reduces redundant data storage. Navigational paths are deeply hardcoded into the system layout; highly complex design that requires skilled programming to maintain. 5 Object-Oriented Stores data records Eliminates object- Lacks standardized

Model natively as programming language objects that contain both data values and operational methods. relational mapping performance costs; integrates smoothly with complex object- oriented software logic. query tooling across different vendors; high processing overhead; steep learning curve for traditional DBAs. 6 Dimensional Model Deploys Star or Snowflake schemas to separate numeric metrics (Facts) from descriptive attributes (Dimensions). Optimized for read speeds, allowing analytical applications to aggregate millions of database rows instantly. Poor performance for small, frequent transaction updates; redundant data is intentionally added to tables to improve read performance. 1.3: THE COMPLETE DATABASE DESIGN LIFECYCLE 1.3.1 Conceptual Design Framework  Objective: Translate raw business processes into a clear conceptual model of entities and relationships. This model remains completely independent of software choices, hardware limits, or storage configurations.  Core Engineering Tasks:

  1. Analyze business interview notes to extract nouns, which become potential Database Entities.
  2. Extract verbs from the notes, which become potential logical Relationships.

(e.g., Order_Age calculated by comparing Order_Date against the system clock). Notated as a dashed oval. 1.3.2.3 Relationship Multiplicities and Mapping Notations  One-to-One (1:1): One record in Table A connects to a maximum of one record in Table B (e.g., Department is managed by Employee).  One-to-Many (1:M): One record in Table A can connect to multiple records in Table B, but a record in Table B connects back to only one record in Table A (e.g., Customer places Orders).  Many-to-Many (M:N): A record in Table A can connect to multiple records in Table B, and a record in Table B can connect to multiple records in Table A (e.g., Student registers for Courses). Note: Relational databases cannot store Many-to-Many connections directly. They must be split into two One-to-Many relationships using a middle associative bridge table. Logical Design & Database Normalization 1.3.4.1 Engineering Steps for Table Schemas

  1. Map every strong entity from the ERD into its own standalone table.
  2. Convert composite attributes into individual column fields within that table.
  3. Create separate lookup tables to resolve multi-valued attributes, linking them back using foreign keys.
  4. Resolve One-to-Many relationships by taking the Primary Key from the "One" side table and inserting it as a Foreign Key into the "Many" side table. 1.3.4.2 Key Archetypes

 Primary Key (PK): A column or combination of columns that uniquely identifies every single row record in a table. It cannot contain null values, and its values can never repeat.  Foreign Key (FK): A column in a table that points directly to the primary key of another table. It creates a structural link between the tables and enforces referential integrity.  Composite Key: A primary key made by combining two or more columns together, used when a single column cannot guarantee unique rows. 1.3.4.3 The Mathematical Logic of Database Normalization Normalization is the step-by-step process of organizing database columns. Its main goals are to eliminate redundant data storage and protect the database from data modification bugs (Insertion, Update, and Deletion Anomalies). Classroom Demonstration Data: Unnormalized Form (UNF) Imagine an unnormalized school spreadsheet row layout look like this: [Student_ID, Student_Name, Registered_Courses (Multi-valued string), Department_ID, Department_Name, Department_Head]

  1. First Normal Form (1NF)  Structural Rule: Eliminate multi-valued attributes and repeating columns. Every column intersection must contain an atomic (indivisible) value from that domain. Every row must be unique, and a primary key must be defined.  Conversion Steps: Split any multi-valued text fields out into individual rows.  Resulting 1NF Table Structure (Composite PK needed): o Table: Student_Course_1NF o Columns: [Student_ID (PK), Course_ID (PK), Student_Name, Department_ID, Department_Name, Department_Head]  The Bug: Partial Dependency exists. Student_Name depends entirely on Student_ID, completely ignoring Course_ID.

o Table 3 (Enrollment Bridge): Course_Enrollments_3NF ➡️ [Student_ID (FK), Course_ID (FK)] 1.3.5 Physical Design Implementation Details 1.3.5.1 Storage Selection and File Organization Architectures During this phase, the designer configures how data blocks are physically handled by the computer storage hardware:  Data Volume Sizing: Calculating row byte sizes to plan storage needs. For instance, estimating daily data growth to determine whether the system requires large hard disk drive (HDD) arrays or ultra-fast solid-state drives (SSDs) for live transactions.  File Organization Configurations: o Heap File Structure: New rows are appended to the end of the file as they arrive. This allows for fast data entry but results in slow search speeds. o Sequential File Structure: Rows are sorted and stored on disk based on an indexing key value. This speeds up lookups but requires processing overhead to sort new data insertions. o Clustered Hashing Structure: A mathematical hashing function uses a key value to determine the exact physical disk coordinates for storing a row, enabling near- instant lookups. 1.3.5.2 Indexing Engineering Strategies Indexes are specialized lookup structures that point directly to data locations on disk, preventing the database engine from having to run slow full-table scans.  B-Tree Indexes (Balanced Tree): The standard database index setup. It organizes key values into a balanced tree structure, enabling rapid searches, updates, and range lookups.

 Hash Indexes: Excellent for exact matching queries (e.g., WHERE Email = '[email protected]'). However, they cannot optimize range searches (e.g., finding orders placed between two dates). 1.3.5.3 Hard Data Integrity Constraints These validation rules are embedded directly into the database schema columns to protect data quality:  NOT NULL: Rejects any data insertion attempt that leaves the column cell blank.  UNIQUE: Ensures no two rows can share the exact same value in this column (e.g., National_ID_Number), while still allowing null values.  CHECK (expression): Evaluates a validation expression before allowing a write operation to finish. If the expression evaluates to false, the transaction is rejected (e.g., CHECK (Employee_Salary >= 15000)). Sample Mid-Topic Assessment Question: A table named Inventory has a primary key combination of [Warehouse_Code, Item_SKU]. It contains a column named Warehouse_Manager_Phone. Is this table in Second Normal Form (2NF)? Explain your reasoning. Expected Answer: No. The manager's phone number depends only on the Warehouse_Code, completely ignoring the Item_SKU. This creates a Partial Dependency, which violates 2NF rules. To fix it, the warehouse details must be moved into their own separate table. TOPIC 2: CREATE COMPUTERIZED DATABASE 2.1: CREATION OF DATABASE OBJECTS 2.1.1 Structural Database Objects Overview 2.1.1.1 Tables (The Relational Storage Core)

Select Queries: Read data values from physical storage without modifying them. They filter columns through projections and restrict rows through selections.  Action Queries: Modify the structural states of tables or the data values inside them. Append queries inject new rows, Update queries alter existing cell values, and Delete queries remove target rows from storage files. 2.1.1.4 Reports (The Analytical Presentation Layer) A report is a structured, formatted output object intended for business distribution, printing, or digital archiving. Unlike tables or forms which are optimized for rapid read/write interaction, reports are strictly read-only structures designed to summarize data.  Report Header Section: Prints exactly once at the absolute beginning of the document sequence, used for title pages and corporate identification.  Page Header Section: Prints automatically at the top of every individual page, housing column labels and section indicators.  Detail Section: Loops through the records provided by the data source, printing one row after another based on the layout template.  Group Header/Footer Sections: Subdivide data dynamically (for example, grouping sales records by region and printing localized mathematical summaries like sub-totals).  Page/Report Footer Sections: Print at the base of every page or at the final end of the document to output summary values, page counts, or system timestamps. 2.1.1.5 Macros (The Visual Automation Layer) A macro is a structured configuration object containing a logical sequence of pre-defined database action steps. It is used to automate user interface activities without requiring full procedural source code.  Operational Execution: Instead of writing text code, a developer uses the macro builder tool to select from a catalog of standard command blocks (such as OpenForm, RunQuery, or CloseWindow) and defines the arguments for each step.

VBA Modules Comparison: If an automation task requires complex loops, conditional handling, or external API interaction, macros are insufficient. The developer must instead write text code inside a VBA (Visual Basic for Applications) Module, which is stored as a distinct code object separate from macros. 2.1.2 Field Attributes and Data Architecture 2.1.2.1 Records A record is a single, complete horizontal entity instance inside a table. It represents the smallest logical collection of related column values that must be treated as a single transactional unit by the storage system. 2.1.2.2 Relational Data Types The designer must bind a primitive data type to every column during table creation to allow the DBMS engine to optimize memory allocations and prevent invalid data operations:  Alphanumeric / Character Data Types (CHAR, VARCHAR, TEXT): Store strings of letters, symbols, and numbers. CHAR allocates a fixed amount of storage space regardless of the text length, making it ideal for standard-length codes like ISO country codes. VARCHAR allocates space dynamically based on the exact number of characters entered, saving storage for unpredictable fields like names or email addresses.  Numeric Data Types (INT, BIGINT, FLOAT, DECIMAL): Store numbers. Integer types (INT) store whole numbers. Approximate floating-point types (FLOAT) store very large numbers or scientific calculations but can introduce rounding errors. Exact numeric types (DECIMAL or NUMERIC) store fixed-point fractions, making them mandatory for currency storage where rounding errors are unacceptable.