
Data-driven programming
Students write code to interact with databases, performing CRUD operations. They use SQL and programming logic to manipulate data.
TL;DR:Data-driven programming is where the logic of code meets the structure of databases. Students learn to use Structured Query Language (SQL) to perform CRUD (Create, Read, Update, Delete) operations, allowing their applications to store and retrieve persistent data. This topic bridges the gap between a static program and a dynamic application that can handle thousands of users and complex datasets.
About This Topic
Data-driven programming is where the logic of code meets the structure of databases. Students learn to use Structured Query Language (SQL) to perform CRUD (Create, Read, Update, Delete) operations, allowing their applications to store and retrieve persistent data. This topic bridges the gap between a static program and a dynamic application that can handle thousands of users and complex datasets.
In the Australian Curriculum, students are expected to write code that interacts securely with a database, handling potential errors and ensuring data integrity. This involves understanding how to map programming variables to database fields and using SQL commands like SELECT, INSERT, and JOIN. This topic is best taught through hands-on 'code-alongs' and collaborative debugging, where students can see the immediate impact of their queries on a live dataset.
Key Questions
- How do applications communicate with databases?
- What are the core SQL commands for data manipulation?
- How do we handle data securely in code?
Watch Out for These Misconceptions
Common MisconceptionSQL is just another programming language like Python.
What to Teach Instead
Students often try to use loops in SQL. Peer-led demonstrations can show that SQL is 'declarative' (telling the computer what you want) rather than 'procedural' (telling it how to do it), which is a major shift in thinking.
Common MisconceptionYou can just concatenate strings to build SQL queries.
What to Teach Instead
This is a dangerous habit that leads to security vulnerabilities. Active 'security audits' of each other's code help students identify why using 'parameterised queries' is the only professional way to handle user data.
Active Learning Ideas
See all activities→Inquiry Circle
SQL Murder Mystery
Students work in small groups to solve a 'crime' by querying a large database. They must use complex SELECT statements with JOINs and WHERE clauses to filter through suspects, locations, and times, sharing their successful queries with the class.
Peer Teaching
CRUD Command Swap
Pairs are assigned one of the CRUD operations. They must create a 2-minute 'lightning talk' explaining the syntax and a common pitfall for their command, then demonstrate it by updating a shared class database.
Simulation Game
The SQL Injection Challenge
Students are shown a simple login form and must work in pairs to 'hack' it using basic SQL injection techniques (in a controlled, local environment). This hands-on approach makes the importance of 'sanitising inputs' and prepared statements immediately clear.
Frequently Asked Questions
What are the most important SQL commands for Year 11?
How do I connect a Python program to a SQL database?
How can active learning help students master SQL?
How do we handle data security in student projects?
More in Application and data solutions
Data and information
Students explore how data is collected, stored, and transmitted in digital systems. They analyse the difference between raw data and meaningful information.
8 methodologies
Relational database concepts
Students design relational databases using entity-relationship diagrams and data dictionaries. They understand primary keys, foreign keys, and data integrity.
8 methodologies
Evaluating digital solutions
Students evaluate their data-driven applications against prescribed criteria and user requirements. They propose refinements based on testing outcomes.
8 methodologies