Compression, Encryption, Hashing and Databases – OCR A Level Computer Science lessons (H446)
Twelve Year 12 lessons on lossy and lossless compression, encryption, hashing, relational databases, keys and normalisation.
Students compare lossy and lossless compression, apply run length encoding and dictionary coding, and use symmetric and asymmetric encryption and hashing. They then design relational databases with entity relationship diagrams and normalise them to third normal form, ready for SQL in Year 13.
Unit 12.11 is taught in Year 12, Summer 2, and answers one big question: How is data kept small, secret and well organised?
What happens in each lesson:
Lesson 1, Lossy and lossless compression: When is it acceptable to throw data away? Main task: compare lossy and lossless compression, and justify which Shutterbox should use for members' competition photos, gallery thumbnails and the app's program updates (6 marks).
Lesson 2, Run length encoding and dictionary coding: How can repeated patterns make a file smaller? Main task: complete the run length encoding of the Shutterbox logo's pixel rows and the dictionary coding of two photo captions, and calculate the size of each before and after, including the dictionary (6 marks).
Lesson 3, Symmetric and asymmetric encryption: How can data stay secret when anyone can intercept it? Main task: describe how a member's private message to a Shutterbox competition judge is encrypted and decrypted with asymmetric encryption, naming whose key is used at each step, and explain one drawback of symmetric encryption for this app (6 marks).
Lesson 4, Public keys, private keys and digital signatures: How can you prove a message really came from you? Main task: explain how the club secretary can digitally sign the Shutterbox competition results so members can check they are genuine and unchanged, naming each key used and what is compared (6 marks).
Lesson 5, Uses of hashing: Why store a fingerprint of data instead of the data? Main task: explain how Shutterbox should store members' passwords using hashing, how a login is checked, and why hashing suits this better than encryption (6 marks).
Lesson 6, Flat files and relational databases: Why split data into many tables? Main task: explain two problems Shutterbox would have if it kept members, photos and competitions in one flat file, and how a relational database would solve each (6 marks).
Lesson 7, Primary and foreign keys: How do tables know which records belong together? Main task: identify the primary key and any foreign keys in Shutterbox's Member, Photo and Entry tables, and explain how the keys link a photo to its member (5 marks).
Lesson 8, Entity relationship modelling: How do we draw the links between the things we store? Main task: draw an entity relationship diagram for Shutterbox's members, photos, competitions and judges, showing the degree of each relationship and resolving any many-to-many relationship (6 marks).
Lesson 9, Normalisation: first normal form: What makes a table well structured? Main task: design first normal form tables from Shutterbox's unnormalised competition entry table, stating the primary key of each table and which rule each change meets (6 marks).
Lesson 10, Normalisation: second and third normal form: How do we make each fact depend on the key alone? Main task: design a set of tables in third normal form for Shutterbox's competition data, starting from the 1NF tables and stating each dependency removed and the primary and foreign keys of each table (8 marks).
Lesson 11, Indexing and secondary keys: How can a database find one record among millions quickly? Main task: explain how adding an index on the Camera field of Shutterbox's Photo table would affect searches and uploads, and why Camera is a secondary key rather than a primary key (6 marks).
Lesson 12, Progress Check: 33 multiple-choice questions (homework or the start of the lesson) + a 40-mark written paper in the lesson (45 minutes)
- Misconceptions it tackles include
- “Lossy compression can be reversed to get the original back”; “Run length encoding always makes data smaller”; “To keep a message secret, the sender encrypts it with their own private key”. Each is planned into a hinge question before the main task or an exit question, so you find out who still holds it.
- OCR H446 specification coverage
- 1.3.1, compression, encryption and hashing: lossy and lossless compression; run length encoding and dictionary coding; symmetric and asymmetric encryption; different uses of hashing; 1.3.2 (a), (c), databases: relational databases, flat files, primary, foreign and secondary keys, entity relationship modelling, normalisation and indexing; normalisation to third normal form.
It builds on 12.3 Data Representation (binary, character sets), 12.8 Data Structures (hash tables), 12.9 Networks and Web Technologies (network security, HTTPS, client-server), and GCSE compression, encryption and databases. Students without GCSE Computer Science need lesson 1's recap of how image file size is worked out. It leads on to 12.12 Programming Project (many projects store their data in a relational database), 13.1 Databases, SQL and Floating Point (SQL, referential integrity and transactions on these tables), 13.5 Legal, Moral, Cultural and Ethical Issues (data protection and encryption) and 13.8 synoptic revision.
- Adapting it for your school
- No flex lesson: every lesson is needed. If time is short, set lesson 4's Build as homework and start lesson 5 with its feedback. Teach after 12.3 and 12.9: lessons 1–2 assume binary and file sizes, and lessons 3–5 assume network security and HTTPS. Lessons are on paper. If students have database software, they can build lesson 10's 3NF tables in it; SQL itself waits for 13.1. Digital signatures (lesson 4) are not named in the spec; they are taught as the main use of a key pair besides secrecy. Shutterbox is fictional. Swap it for any club or school system your students know with members, uploads and events; every Build keeps its structure.
An independent resource written for OCR A Level Computer Science (H446). It is not endorsed by OCR or Cambridge University Press & Assessment. Programming project (NEA) lessons teach general skills on a made-up example project and give supervised time, within JCQ's rules on the help a centre may give.
What's included
- 12 lesson slide decks (PowerPoint)
- 12 lesson plans (Word)
- 12 worksheets, plus 11 support versions with scaffolds (Word)
- 1 exam-style paper with mark scheme (Word)
- Medium term plan with intent, key words, misconceptions and adaptive teaching notes (Word)
- Progress Check lesson to assess the unit
- Indexing and secondary keys - Quiz Quiz Trade Cards
- Department licence: every teacher in your department can use and adapt it
In this bundle
Worth £48 bought separately at £4 a lesson. The bundle saves you 6%.
More for A Level Computer Science
See allFifteen Year 12 lessons on registers, buses, the fetch–decode–execute cycle, performance, pipelining, CISC and RISC, GPUs and storage.
Free sample lessonSixteen Year 12 lessons on programming foundations: variables, selection, iteration, subroutines, parameters, files and computational thinking.
Free sample lessonThirteen Year 12 lessons on binary and hex, sign and magnitude, two's complement, shifts, bitwise masks, character sets and logic gates.
Free sample lessonWritten for the specifications named. Not endorsed by or affiliated with any exam board.