Representing Text and Images
Understanding character encoding (ASCII, Unicode) and bitmap image representation.
About This Topic
Relational database design is about organizing data so that it is accurate, consistent, and easy to retrieve. Students learn to create Entity-Relationship Diagrams (ERDs) to model real-world systems and use normalization to eliminate redundant data. This is a shift from thinking about data as a single 'flat' spreadsheet to seeing it as a web of interconnected tables.
In the Singapore context, database design is the backbone of our Smart Nation infrastructure, from the National Electronic Health Record to the HDB's housing systems. Students learn how to handle complex relationships, such as many-to-many interactions between students and CCA groups. This topic particularly benefits from hands-on, student-centered approaches where students model data for systems they use every day, like a school library or a food delivery app.
Key Questions
- Explain how different character encoding schemes impact global communication.
- Compare vector graphics and bitmap graphics in terms of storage and scalability.
- Analyze the trade-offs between file size and image quality for different image formats.
Learning Objectives
- Compare the storage efficiency and scalability of bitmap images versus vector graphics.
- Analyze the trade-offs between file size and visual fidelity for common image formats like JPEG, PNG, and GIF.
- Explain how different character encoding schemes, such as ASCII and Unicode, facilitate or hinder global digital communication.
- Design a simple bitmap representation for a given icon using a specified pixel grid and color palette.
Before You Start
Why: Students need to understand how to represent numbers and data using binary digits (bits) to grasp character encoding and pixel color values.
Why: Understanding fundamental data types like integers and characters is necessary to comprehend how they are encoded into binary.
Key Vocabulary
| Bitmap Image | An image file format that stores graphical information as a grid of pixels, where each pixel has a specific color value. |
| Pixel | The smallest controllable element of a picture represented on the screen, a single point in a graphic image. |
| ASCII | An early character encoding standard that uses 7 or 8 bits to represent English letters, numbers, and symbols, limiting its character set. |
| Unicode | A character encoding standard designed to represent text from all writing systems, using variable-length encoding to accommodate a vast range of characters. |
| Color Depth | The number of bits used to represent the color of a single pixel, determining the total number of colors that can be displayed. |
Watch Out for These Misconceptions
Common MisconceptionPutting all data into one big table is easier and faster.
What to Teach Instead
Flat tables lead to data redundancy and 'update anomalies' (where changing a value in one place doesn't change it elsewhere). A 'data entry' simulation where students try to update a flat table versus a normalized one quickly shows the benefits of normalization.
Common MisconceptionPrimary keys can be anything, like a person's name.
What to Teach Instead
Primary keys must be unique and unchanging. Since names can change or be shared, using a unique ID is essential. Peer review of ERDs helps students identify 'weak' primary keys before they become a problem.
Active Learning Ideas
See all activitiesInquiry Circle: ERD Design Challenge
Groups are given a scenario, like a 'Grab-style' ride-hailing app. They must identify the entities (Drivers, Riders, Trips) and their attributes, then use large sheets of paper to draw the relationships and cardinalities between them.
Stations Rotation: The Normalization Hospital
Set up stations with 'sick' (un-normalized) tables full of redundant data and update anomalies. Students must 'cure' the tables by breaking them down into 1NF, 2NF, and 3NF, explaining their reasoning at each step.
Think-Pair-Share: Real-World Relationships
Students think of a many-to-many relationship in their school life (e.g., Students and Subjects). They pair up to discuss why a 'junction table' is necessary to model this in a relational database and what data that table should hold.
Real-World Connections
- Software engineers developing international applications must choose Unicode to ensure their user interfaces correctly display text in multiple languages, from Cyrillic to Mandarin.
- Graphic designers at advertising agencies select image formats like JPEG for web banners due to its good compression for photographic images, balancing file size with acceptable quality for online display.
- Web developers use PNG for logos and icons on websites because it supports transparency and lossless compression, ensuring sharp edges and clear graphics.
Assessment Ideas
Provide students with a small 8x8 pixel grid and a limited 4-color palette. Ask them to draw a simple smiley face and then write the binary code for the color of one pixel and its coordinates (e.g., Pixel (3,5) is color 01).
Pose the question: 'Imagine you are designing a new global messaging app. Which character encoding would you choose and why? What are the potential problems if you chose the other main option?' Facilitate a class discussion comparing ASCII and Unicode for this scenario.
Show students two images of the same graphic: one a high-resolution bitmap and one a scalable vector graphic. Ask them to identify which is which and explain one key difference in how they would scale or be stored, based on their properties.
Frequently Asked Questions
What is the goal of database normalization?
What is the difference between a primary key and a foreign key?
How can active learning help students understand database design?
When should I use a many-to-many relationship?
More in Data Representation and Databases
Binary and Hexadecimal Systems
Representing numbers, text, and media using binary systems and understanding overflow errors.
2 methodologies
Introduction to Databases
Understanding the purpose of databases, common database models, and key terminology.
2 methodologies
Designing Simple Database Tables
Students will learn to identify key pieces of information (fields) and organize them into logical tables for a simple database, understanding the concept of primary keys.
2 methodologies
Basic Database Operations (SQL SELECT)
Students will learn to use basic SQL SELECT statements to retrieve specific data from a single database table.
2 methodologies
SQL: Data Manipulation Language (DML)
Using Structured Query Language to retrieve, filter, and modify data stored in databases.
2 methodologies