Database Systems
What is a Number System; The Binary System; Converting Decimal to Binary; The Octal System; The Hexadecimal System; Converting Between Systems
On this page10 sections
- 01Learning Objectives
- 02Starter Scenario
- 03What is a Number System
- 04The Binary System
- 05Converting Decimal to Binary
- 06The Octal System
- 07The Hexadecimal System
- 08Converting Between Systems
- 09Practical Work
- 10Scenario-Based Questions
Learning Objectives
- Explain place value in the decimal and binary systems.
- Convert numbers between decimal, binary and hexadecimal.
- Describe the octal system and what it is used for.
- Explain why computers use the binary system.
Starter Scenario
Amina's younger brother asks her, how does a computer count, it does not have fingers like we do. Amina thinks about her ten fingers and the decimal system she uses for counting, then wonders how a machine with only electrical signals can represent numbers at all. Computers use electric circuits that are either on or off, much like a light switch. An on state can represent 1 and an off state can represent 0. Using only these two digits, computers represent every number, letter, picture and sound. This is the binary system.
What is a Number System
A number system is a way of representing numbers using a specific base and a set of digits. The base of a number system tells you how many distinct digits it uses and how the value of each position increases. Every number system works on the same principle of place value. In the decimal system we use every day, each position from right to left multiplies by 10 because the decimal system has a base of 10.
The decimal system is base 10, meaning it uses ten digits from 0 to 9. Each position in a decimal number represents a power of 10. The positions from right to left are ones, which is 10 to the power 0, tens, which is 10 to the power 1, hundreds, which is 10 to the power 2, thousands, which is 10 to the power 3, and so on. Consider the number 2473. The digit 3 is in the units position with a place value of 1, giving 3 times 1 equals 3. The digit 7 is in the tens position with a place value of 10, giving 7 times 10 equals 70. The digit 4 is in the hundreds position with a place value of 100, giving 4 times 100 equals 400. The digit 2 is in the thousands position with a place value of 1000, giving 2 times 1000 equals 2000. Then 2473 equals 2000 plus 400 plus 70 plus 3. This same principle of place value applies to every number system, but the base changes.
The Binary System
The binary system is base 2, using only two digits, 0 and 1. Each position in a binary number represents a power of 2. The positions from right to left are ones, which is 2 to the power 0, twos, which is 2 to the power 1, fours, which is 2 to the power 2, eights, which is 2 to the power 3, sixteens, which is 2 to the power 4, and so on. Consider the binary number 1101. The digit 1 is in the ones position with a place value of 1, giving 1 times 1 equals 1. The digit 0 is in the twos position with a place value of 2, giving 0 times 2 equals 0. The digit 1 is in the fours position with a place value of 4, giving 1 times 4 equals 4. The digit 1 is in the eights position with a place value of 8, giving 1 times 8 equals 8. Then binary 1101 equals 8 plus 4 plus 0 plus 1, which is 13 in decimal.
Converting Decimal to Binary
To convert a decimal number to binary, repeatedly divide by 2 and record the remainders. The remainders, read from bottom to top, give the binary number. For example, to convert 13 to binary, first divide 13 by 2 to get 6 with remainder 1. Then divide 6 by 2 to get 3 with remainder 0. Then divide 3 by 2 to get 1 with remainder 1. Then divide 1 by 2 to get 0 with remainder 1. Reading the remainders from bottom to top gives 1101. So decimal 13 equals binary 1101. Learners can verify this by converting back, since 1101 equals 8 plus 4 plus 0 plus 1, which is 13.
The Octal System
The octal system is base 8, using digits from 0 to 7. Each position represents a power of 8. The positions are ones, which is 8 to the power 0, eights, which is 8 to the power 1, sixty-fours, which is 8 to the power 2, and so on. Octal is useful because every three binary digits can be grouped into one octal digit. This makes long binary numbers easier to read. For example, binary 000 equals octal 0, binary 001 equals octal 1, binary 010 equals octal 2, and so on up to binary 111 equals octal 7. To convert a binary number to octal, group the binary digits in threes from the right, then replace each group with its octal equivalent.
The Hexadecimal System
The hexadecimal system, often called hex, is base 16, using the digits 0 to 9 and the letters A, B, C, D, E and F. The letters stand for the decimal values 10, 11, 12, 13, 14 and 15. Every four binary digits map to exactly one hexadecimal digit, making binary strings much shorter and easier to read. For example, binary 0000 equals hex 0, binary 0001 equals hex 1, and so on through binary 1001 equals hex 9, binary 1010 equals hex A, binary 1011 equals hex B, binary 1100 equals hex C, binary 1101 equals hex D, binary 1110 equals hex E, and binary 1111 equals hex F.
Converting Between Systems
There are three main conversion directions learners should master. To convert binary to decimal, multiply each binary digit by its place value and add the results. For example, binary 1101 equals (1 times 8) plus (1 times 4) plus (0 times 2) plus (1 times 1), which equals 8 plus 4 plus 0 plus 1, which is 13. To convert decimal to binary, repeatedly divide by 2 and read remainders from bottom to top. For example, decimal 13 equals binary 1101. To convert binary to hexadecimal, group in fours from the right and replace each group. For example, binary 10110101 grouped as 1011 and 0101 equals B5 in hexadecimal.
| Number System | Base | Digits Used | Family of Use |
|---|---|---|---|
| Decimal | 10 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 | Everyday human counting |
| Binary | 2 | 0, 1 | Computers and electric circuits |
| Octal | 8 | 0, 1, 2, 3, 4, 5, 6, 7 | Early computing and compact representation |
| Hexadecimal | 16 | 0 to 9 and A, B, C, D, E, F | Memory addresses and colours |
| Hex Digit | Decimal Value | Binary Equivalent |
|---|---|---|
| 0 | 0 | 0000 |
| 1 | 1 | 0001 |
| 2 | 2 | 0010 |
| 3 | 3 | 0011 |
| 4 | 4 | 0100 |
| 5 | 5 | 0101 |
| 6 | 6 | 0110 |
| 7 | 7 | 0111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
Practical Work
- Write the place values of the binary number 1101 and convert it to decimal.
- Convert the decimal number 13 to binary by repeated division.
- Convert the binary number 10110101 to hexadecimal.
- Write the hexadecimal digits and their decimal values from 0 to F.
Scenario-Based Questions
- A computer stores the number 1011 in binary. A pupil says this is the same as one thousand and eleven in decimal. Convert 1011 from binary to decimal to show the pupil the correct answer.
- A school wants to label 16 network cables from 0 to 15 using hexadecimal numbers. Write out the 16 labels and explain why hexadecimal is shorter than using binary for the same labels.
- A market trader counts her goods in tens and ones, for example 23 means 2 tens and 3 ones. Explain how this is like positional value in the decimal system and how binary uses the same idea with only 0 and 1.
- A pupil converts the decimal number 13 to binary by dividing by 2 and gets 1101. Write out the step-by-step division showing the remainders to prove the answer is correct.
- A radio station uses the number C4 in hexadecimal to label a frequency channel. Convert C4 to decimal and then to binary.
- A teacher writes the number 77 on the board and asks the class to convert it to binary and to hexadecimal. Show both conversions.
- Explain why computers use binary instead of decimal, linking your answer to the electrical state of a circuit.
LEARNING OBJECTIVES: BY THE END OF THE LESSON PUPILS SHOULD BE ABLE TO:
| Cognitive | i. Explain place value in the decimal and binary systems. ii. Convert numbers between decimal, binary and hexadecimal. iii. Describe the octal system and what it is used for. iv. Explain why computers use the binary system. |
| Affective | i. Appreciate the value of Number Systems in school, at home and in the community. ii. Show willingness to use digital tools carefully, safely and responsibly. |
| Psychomotor | i. Write the place values of the binary number 1101 and convert it to decimal. ii. Convert the decimal number 13 to binary by repeated division. iii. Convert the binary number 10110101 to hexadecimal. iv. Write the hexadecimal digits and their decimal values from 0 to F. |
Rationale: A number system is a way of representing numbers using a specific base and a set of digits. Understanding starter Scenario, what is a Number System, the Binary System, converting Decimal to Binary helps learners use digital technology confidently, safely and responsibly.
Pre-requisite Knowledge: In Week 4, learners studied Network Devices and Protocols, including network Devices in Depth, network Protocols, tCP/IP. The knowledge from that week is used again in this lesson.
Learning Material/Teaching Aid: Whiteboard, markers, computer or laptop where available, printed notes and charts on Number Systems, practical task sheets, learners' notebooks and pens.
Reference Materials: Digital Technology for Junior Secondary Schools (JSS 3); NERDC Digital Technology Curriculum; Digital Technology JSS 3 First Term Notes (Week 5); First Term examination and Continuous Assessment question papers.
LESSON DEVELOPMENT
| Stage/Step (Time) | Teacher's Activities | Student's Activities | Learning Points |
|---|---|---|---|
| Introduction 5 MINUTES | Welcomes learners, revises Week 4 (Network Devices and Protocols) with two quick oral questions, and asks what they already know about Number Systems. Elicits responses and writes the topic on the board. | Recall the previous lesson and share what they already know about Number Systems. | Connecting prior knowledge to Number Systems. |
| Step 1 6 MINUTES | Covers Starter Scenario: Amina's younger brother asks her, how does a computer count, it does not have fingers like we do. Amina thinks about her ten fingers and the decimal system she uses for counting, then wonders how a machine with only electrical signals can represent numbers at all. Covers What is a Number System: A number system is a way of representing numbers using a specific base and a set of digits. The base of a number system tells you how many distinct digits it uses and how the value of each position increases. | Listen, take notes and answer oral questions on "Starter Scenario" and related points. | Understanding: Starter Scenario; What is a Number System. |
| Step 2 6 MINUTES | Covers The Binary System: The binary system is base 2, using only two digits, 0 and 1. Each position in a binary number represents a power of 2. Covers Converting Decimal to Binary: To convert a decimal number to binary, repeatedly divide by 2 and record the remainders. The remainders, read from bottom to top, give the binary number. | Copy the key points, give examples from school and everyday life, and ask questions on "The Binary System" and related points. | Understanding: The Binary System; Converting Decimal to Binary. |
| Step 3 6 MINUTES | Covers The Octal System: The octal system is base 8, using digits from 0 to 7. Each position represents a power of 8. Covers The Hexadecimal System: The hexadecimal system, often called hex, is base 16, using the digits 0 to 9 and the letters A, B, C, D, E and F. The letters stand for the decimal values 10, 11, 12, 13, 14 and 15. | Discuss in pairs, then report one point on "The Octal System" and related points to the class. | Understanding: The Octal System; The Hexadecimal System. |
| Step 4 6 MINUTES | Covers Converting Between Systems: There are three main conversion directions learners should master. To convert binary to decimal, multiply each binary digit by its place value and add the results. | Respond to questions, complete the examples on the board and note down "Converting Between Systems". | Understanding: Converting Between Systems. |
| Practical Work 6 MINUTES | Guides learners through the practical work: (i) Write the place values of the binary number 1101 and convert it to decimal. (ii) Convert the decimal number 13 to binary by repeated division. (iii) Convert the binary number 10110101 to hexadecimal. Moves round the class to check progress and correct unsafe or careless use. | Carry out the practical tasks individually or in pairs and record what they did in their notebooks. | Applying the lesson through hands-on practice. |
| Evaluation 3 MINUTES | Asks learners to: i. Explain place value in the decimal and binary systems. ii. Convert numbers between decimal, binary and hexadecimal. iii. Describe the octal system and what it is used for. iv. Explain why computers use the binary system. | Respond verbally and in writing to the evaluation questions. | Assessment and consolidation of the lesson content. |
| Conclusion 2 MINUTES | Recaps the main points: starter Scenario, what is a Number System, the Binary System, converting Decimal to Binary, the Octal System. Links them to the assignment and previews Week 6: Binary Numbers and Data Representation. | Listen, ask questions and copy the assignment. | Reinforcement of key concepts and a preview of the next lesson. |
Assignment: i. A computer stores the number 1011 in binary. A pupil says this is the same as one thousand and eleven in decimal. Convert 1011 from binary to decimal to show the pupil the correct answer. ii. A school wants to label 16 network cables from 0 to 15 using hexadecimal numbers. Write out the 16 labels and explain why hexadecimal is shorter than using binary for the same labels.
On this page9 sections
- 01Lesson objectives
- 02Key vocabulary
- 03Common misconceptions
- 04Teacher activities
- 05Student activities
- 06Practical / learning evidence
- 07Resources and preparation
- 08Assessment for learning
- 09Inclusion and homework
Lesson objectives
By the end of the week, learners should be able to:
- Define a database system and describe its role in organisations.
- Name the main components of a relational schema.
- Write basic SQL CREATE TABLE statements for fields and constraints.
- Describe a primary key and a foreign key and their roles.
- Judge whether a schema satisfies business rules.
Key vocabulary
- Database system: software storing, managing and retrieving records.
- Schema: the design defining tables, fields and relationships.
- Relational schema: a tabular schema holding linked tables.
- CREATE TABLE: SQL syntax declaring a new table.
- Field: a column holding a characteristic of each record.
- Constraint: a rule limiting allowed data values.
- Primary key: a unique identifier for each record within a table.
- Foreign key: a field linking a row in one table to another.
- Business rule: an operational requirement a schema must satisfy.
Common misconceptions
- "A database is just a spreadsheet." Databases enforce constraints and relationships that spreadsheets ignore.
- "SQL creates empty tables only." SQL can insert data and define relationships too.
- "Primary keys can share values." Primary keys must uniquely identify each record.
Teacher activities
- Starter: ask where a school keeps student records if not on a teacher's desktop.
- Define a database system and describe its organisational role.
- Name the main relational schema components one by one.
- Demonstrate writing a CREATE TABLE statement with constraints.
- Define primary and foreign keys with a worked example.
- Close with the schema-satisfies-rule task and exit question.
Student activities
- Answer the starter and identify the right storage location.
- Define a database system in their own words and state its role.
- Name the main relational schema components in one sentence each.
- Write a CREATE TABLE statement with fields and constraints.
- Define a primary key and a foreign key with one example each.
- Judge whether a given schema satisfies the stated business rules.
- Answer the exit question in one sentence about databases versus spreadsheets.
Practical / learning evidence
A CREATE TABLE worksheet, a primary-key-versus-foreign-key example and a schema-satisfies-rule worksheet. Submit all three for marking.
Resources and preparation
Printed SQL templates, blank schema diagrams and sample business rules. Offline route: paper versions, no device needed. Display any DBMS installation carefully and avoid touching live databases.
Assessment for learning
Inspect the CREATE TABLE for correct syntax and constraint names. Check the PK versus FK example for correct links. Mark the schema-satisfies-rule for defensible judgement. Flag any learner who calls the database a big spreadsheet.
Inclusion and homework
Provide the CREATE TABLE prefilled for field and constraint names and allow oral SQL. Extend confident learners with two CREATE TABLE statements and a third homework to verify foreign-key integrity. Homework: name one advantage and one disadvantage of relational databases over spreadsheets.