Computer Studies (AKU-CS)
Topic 3 of 7Aga Khan Board

Data & Databases

Data types, file storage, databases and SQL basics

Data is raw facts and figures. Information is processed, meaningful data.


Data types:

  • Integer: whole numbers (e.g., age = 17)
  • Real/Float: decimal numbers (e.g., price = 149.99)
  • Character: single symbol (e.g., 'A')
  • String: sequence of characters (e.g., "Muhammad Ali")
  • Boolean: True or False (e.g., is_passed = True)
  • Date/Time: e.g., 25/03/2026

  • File storage concepts:

  • Record: one complete entry (e.g., one student's data)
  • Field: one item within a record (e.g., student name)
  • Key field: unique identifier for each record (e.g., student ID)

  • Databases store data in organised tables (like a structured spreadsheet). Relational databases link tables using foreign keys.


    Basic SQL:

  • `SELECT * FROM students WHERE grade = 'A';` — retrieve records
  • `INSERT INTO students VALUES (1, 'Fatima', 'A');` — add a record
  • `UPDATE students SET grade = 'B' WHERE id = 1;` — modify a record
  • `DELETE FROM students WHERE id = 1;` — remove a record

  • Data validation: checks data is reasonable (range check, type check, presence check, length check). **Verification:** checks data was entered correctly (double entry, proofreading).

    Key Points to Remember

    • 1Integer, real, string, Boolean, date/time — key data types
    • 2Record = full entry; field = one item; key field = unique ID
    • 3SQL: SELECT, INSERT, UPDATE, DELETE
    • 4Validation checks data is reasonable; verification checks it was entered correctly

    Pakistan Example

    NADRA — Pakistan's National Database and Data Management

    NADRA (National Database and Registration Authority) manages 220+ million Pakistanis' records. Each citizen has a unique CNIC (key field). Fields include name, date of birth, address, and fingerprint data. NADRA uses relational databases to link CNIC to passport, driving licence, and tax records — real-world database design on a national scale.

    Test Your Knowledge!

    3 questions to check if you understood this topic.

    Start Quiz