Concept Explainer • No Answers Spoiled

Assignment Concept Guide

Clear plain-English explanations and step-by-step thinking guides for DTS304 (Data Management) and NUK-CYB 308 (Python Data Analysis) — designed to help you understand and write your own solutions confidently.

Section 1 • Questions 1–10 Database Foundations, File Systems & People Behind Databases
▾
Concept Explanation
  • 4 Core Terms (Q1): A Database is the organized collection of related data itself. A DBMS is the software (like MySQL or PostgreSQL) that creates, protects, and queries that data. A Database System = Database + DBMS + software/users around it. A Database Application is the user-facing program (like a school portal) that talks to the DBMS.
  • Database vs. Traditional File Systems (Q2, Q6, Q7): In old file systems, each department kept its own separate files—causing data redundancy (saving the same student address 5 times) and data inconsistency (updating one file but forgetting the others). A DBMS keeps one shared, controlled source of truth with self-describing metadata, program-data independence, and multi-user concurrency.
  • People in Databases (Q3, Q4, Q5, Q10): Actors on the scene directly use or design the database (DBA = security/backups/permissions; Designers = decide tables & relationships; End-users = clerks/managers; Analysts & Programmers = build apps). Workers behind the scene build and maintain the DBMS software itself (engine developers, tool vendors).
  • When NOT to Use a DBMS (Q9): When the database is tiny and simple, requires strict real-time speed with no multi-user overhead, or when licensing/hardware setup costs outweigh the benefits.
How to Write Your Answers

For comparison questions (like Q2 or Q10), draw a clean 2-column table on paper. Give 1 real-life university example (e.g., Registry vs. Bursary keeping different addresses for the same student) to make redundancy and inconsistency crystal clear.

Section 2 • Questions 1–12 Data Models, Three-Schema Architecture, DDL/DML & Client/Server
▾
Concept Explanation
  • Conceptual vs. Logical vs. Physical Models (Q1–Q2): Conceptual = high-level picture for humans (entities & relationships, no tech jargon). Logical / Representational = tables and columns (relational model). Physical = how bytes, indexes, and files sit on disk.
  • Schema vs. State/Instance (Q3): The Schema is the blueprint/table structure (rarely changes). The State (Instance) is the actual rows currently inside the tables (changes every second as people insert/delete).
  • Three-Schema Architecture & Data Independence (Q4–Q5):
    1. External Level: Customized views for different users (hides sensitive columns).
    2. Conceptual Level: Complete logical structure of the whole database.
    3. Internal Level: Physical storage paths and indexes on disk.
    Logical data independence means changing the conceptual schema without breaking external views. Physical data independence means changing disk storage/indexes without breaking the conceptual schema.
  • DDL vs. DML (Q6): DDL (Data Definition Language) defines or changes the structure (CREATE, ALTER, DROP). DML (Data Manipulation Language) reads or changes the rows (SELECT, INSERT, UPDATE, DELETE).
  • Two-Tier vs. Three-Tier (Q9–Q10): In Two-tier, the client app talks directly to the DB server. In Three-tier, a middle application/web server sits between the browser and the DB server for better security and scalability.
How to Write Your Answers

For Q4, draw three stacked boxes labeled External → Conceptual → Internal with arrows between them so your handwritten answer stands out immediately.

Section 3 & Mandatory Practical 1 ER Modeling & University Course Registration ERD Design
▾
Concept Explanation
  • Building Blocks (Q2–Q4): Entity Type = category (e.g., STUDENT); Entity Instance = one specific student. Attributes describe properties: Key (underlined, unique), Composite (can split, like Name → First + Last), Multivalued (double oval, like multiple phone numbers), Derived (dashed oval, like Age from DOB).
  • Relationships, Degree & Cardinality (Q5–Q8): Degree = how many entities participate (Unary = 1, Binary = 2, Ternary = 3). Cardinality = max links (1:1, 1:N, M:N). Participation = minimum links: Total (double line = must participate) vs. Partial (single line = optional).
  • Weak vs. Strong Entities (Q9–Q10): A Strong entity has its own full primary key. A Weak entity (double rectangle) has no standalone key—it relies on a Partial Key (dashed underline) plus an Identifying Relationship (double diamond) to its owner.
How to Design the Mandatory University Registration ERD Yourself
  1. List the nouns in the scenario as rectangles: DEPARTMENT, LECTURER, STUDENT, COURSE.
  2. Attach every attribute mentioned in the text as ovals, and underline the unique IDs (DeptNo, StaffID, StudentID, CourseCode).
  3. Turn every rule/verb into a diamond with cardinality:
    • Department ↔ Lecturer (one department has many lecturers; each lecturer belongs to one department → 1:N).
    • Department ↔ Course (1:N).
    • Student ↔ Course (students register for many courses; courses have many students → M:N — put RegistrationDate, Semester, Grade on the relationship diamond!).
Section 5 & Mandatory Practical 2 ER-to-Relational Mapping (Tables, Primary & Foreign Keys)
▾
How the Mapping Algorithm Works
  • Strong Entities: Each rectangle becomes a table; its key attribute becomes the Primary Key (PK). Composite attributes flatten into simple columns.
  • 1:N Relationships: Never create a separate table for 1:N! Take the PK of the "1" side and place it inside the "N" side table as a Foreign Key (FK).
  • M:N Relationships: You must create a new junction/bridge table! Its columns are the PKs of both linked entities (together forming a Composite Primary Key and individual Foreign Keys) plus any relationship attributes (like Semester, Grade).
  • Weak Entities & Multivalued Attributes: Weak entity gets the owner's PK + its own partial key as a composite PK. Multivalued attributes get their own separate table with (Owner PK + Attribute) as PK.
How to Do the Mandatory Mapping Practical

Write each relation cleanly in schema notation like TABLE_NAME(PK, Col2, Col3, FK*), clearly labeling which column is the Primary Key, which is a Foreign Key, and which table has a Composite Key (your REGISTRATION bridge table!).

Section 6 & Mandatory Practical 3 SQL Theory, Constraints & Practical SQL Queries
▾
Concept Explanation
  • Integrity Constraints (Q4–Q5, Q8–Q9): Entity Integrity = Primary Key cannot be NULL. Referential Integrity = every Foreign Key value must match an existing Primary Key (or be NULL), with actions like ON DELETE CASCADE or RESTRICT.
  • Key SQL Clauses (Q6): SELECT (columns to show) • FROM (table) • WHERE (filter individual rows before grouping) • GROUP BY (bundle rows for COUNT/AVG) • HAVING (filter groups after GROUP BY) • ORDER BY (sort result).
How to Approach Practical SQL (a–h)
  • a & b (CREATE TABLE): Pick sensible types (VARCHAR, INT), declare PRIMARY KEY, and on COURSE add FOREIGN KEY (DepartmentID) REFERENCES DEPARTMENT(DepartmentID).
  • c (INSERT): Match the exact column order of STUDENT when writing VALUES (...) for three records.
  • d, e, h (SELECT): Use WHERE Gender = 'Female' for (e), and filter by DepartmentID on COURSE for (h).
  • f & g (UPDATE / DELETE): Always include WHERE StudentID = '...' so you only modify or remove that one student, never the whole table!
Page 16 • Mandatory Individual Submission Practical Assignment Guide: Student Performance & Attendance Analysis
▾
What the Lecturer Is Testing

The lecturer wants to see that you can take a messy real-world CSV file, spot bad data without hiding it, clean it responsibly in Python (pandas), visualize the findings, and explain what you did in a short reproducible report.

  • Trap 1 — Duplicate Record: Look closely at the last row—S03 appears twice with identical scores. Decide how to deduplicate (keep first) and log it.
  • Trap 2 — Missing Values (—): Four rows (S05 Python, S06 Java, S09 Database, S12 Attendance) have dashes. Leave them empty in student_performance.csv so pandas loads them as NaN, then decide whether to impute (e.g., median/mean) or drop—and justify your choice!
  • Trap 3 — Out-of-Range Score: Look at S11: Python score is 105 (valid exam scores are 0–100). Flag it, decide whether to cap/set to NaN/correct, and explain why in your report.
Submission Checklist (Tick as You Complete)
  • Use relative paths only (e.g., pd.read_csv("student_performance.csv"), never C:/Users/...).
  • Include both original student_performance.csv and your cleaned CSV file.
  • Include your .ipynb notebook or .py script.
  • Export clear PNG charts (course comparison, attendance vs. score scatter plot, etc.).
  • Write a 1–2 page report with your Name, Reg. No., steps to reproduce, cleaning decisions, and findings.
  • Zip all files and email to zspaki@nwu.edu.ng on/before exam day.
Module 1 • Sets 01–08 Core Python Data Structures, Mutability & Control Flow
▾
Key Concepts to Master
  • Mutable vs. Immutable (Sets 02–04, 07): Strings and Tuples cannot be changed in place; Lists, Sets, and Dictionaries can. Watch out for aliasing (b = a shares the same list in memory) vs. shallow/deep copying.
  • Choosing the Right Collection (Sets 05–06): Use a set to remove duplicates and test fast membership; use a dict for key-value lookups (e.g., student ID → scores).
  • Comprehensions (Set 08): One-line loops like [x*x for x in nums if x > 0] replace multi-line for + append() cleanly.
Module 2 • Sets 09–12 Functions, Scope, Recursion & Generators
▾
Key Concepts to Master
  • Parameters (Sets 09–10): Never use a mutable default argument like def f(items=[])—use None instead. *args collects extra positional arguments as a tuple; **kwargs collects keyword arguments as a dict.
  • LEGB Scope & Recursion (Set 11): Python looks up names in Local → Enclosing → Global → Built-in order. Every recursive function needs a base case to stop and a recursive step moving toward it.
  • Generators (Set 12): Functions using yield produce values one at a time lazily, saving RAM on large datasets.
Modules 3 & 4 • Sets 13–24 Object-Oriented Programming (OOP) & Exception Handling
▾
Key Concepts to Master
  • OOP Pillars (Sets 13–20): Encapsulation hides internal fields (with @property validation); Inheritance lets a subclass reuse/override parent methods via super(); Polymorphism lets different objects share one interface; Composition ("has-a") is often cleaner than deep inheritance ("is-a").
  • Exceptions (Sets 21–24): Use try (risky code), except SpecificError (never bare except:), else (runs only if no error), and finally (always cleans up files/resources).
Module 5 • Sets 25–30 NumPy, pandas, Matplotlib & Statistical Interpretation
▾
Key Concepts to Master
  • NumPy (Sets 25–26): axis=0 computes down columns (e.g., per subject); axis=1 computes across rows (e.g., per student). Basic slices share memory (use .copy() when needed). Use np.clip(..., 0, 100) to cap values at 100.
  • pandas (Sets 27–28): Series = 1D column; DataFrame = 2D table. loc selects by label (inclusive end); iloc selects by integer position (exclusive end). Use to_csv("out.csv", index=False) to export cleanly.
  • Matplotlib & Interpretation (Sets 29–30): Bar chart = categories; Histogram = distribution/bins; Line chart = trend over time; Scatter plot = relationship between two numeric variables. Remember: correlation does not prove causation!