Diving into data: Teaching SQL to high school students

This week we welcome guest blogger Bruce Fuda, 2016 Australian ICT Educator of the Year, introducing our new SQL course.

We are all exposed to large amounts of data every day without even realising it. From the moment we wake up, we make sense of our world through the data we collect — the things we see, the sounds we hear, the way people act and how we feel.

The way we interact with computers has also changed as they’ve become more powerful and portable. We expect them to track our fitness activities, know when we need to leave for our next appointment, share updates from our friends or present us with tasty options for dinner. For applications and systems to meet these expectations, they need a way to store and process the data we generate.

Smartphones and watches capture lots of different types of data

One way that digital systems are able to make sense of the data we feed them is by storing it in databases. There are many different types of databases in use across the world — some have been in use for a long time like those in banks and libraries, but others are relatively new, and drive the technology behind apps like Facebook, Amazon and our own Grok Learning platform.

Some of the fundamental concepts that underpin the Australian Curriculum: Digital Technologies include how data is represented, managed, analysed and interpreted:

Year 7/8: Analyse and visualise data using a range of software to create information, and use structured data to model objects or events (ACTDIP026)

Year 9/10: Analyse and visualise data to create information and address complex problems, and model processes, entities and their relationships using structured data (ACTDIP037)

Understanding how data is structured to enable the technologies we often take for granted is critical to address the expectations of the curriculum, and databases provide students with an opportunity to explore these concepts in a real-world context.

When teaching Structured Query Language (SQL) to students in Year 10, I’ve found that the data I use and the applications I ask students to build are ultimately what determines the level of engagement. Using artificial or boring examples is a sure-fire way to turn students off, so it is important that teachers look for issues or contexts they’re interested in exploring. A good way to do this is to use real-world data in your lesson activities, and have them identify a collection or topic they’re excited about when working on assessment tasks.

Accessing, filtering and presenting data

To introduce students and teachers to queries in databases, we’ve released our first SQL course that uses real data sets from around the world. These data sets range from the Australian Threatened Species list through to the UNHCR International Persons of Concern.

The course is aimed at high school classes from years 7–10, and covers aspects of data management and analysis from the Australian Curriculum: Digital Technologies. It doesn’t assume any existing knowledge about databases or SQL, so is ideal for students who are working with databases for the first time.

A simple query (of a database of threatened animal species) using a SELECT statement

Through interactive examples and scaffolded questions, students learn the basics of querying data stored in single table databases. This begins with the fundamental structure of simple SELECT statements, and builds up to more advanced filtering and sorting using WHERE and ORDER BY clauses.

A more complex query (of UNHCR data) with advanced filtering and sorting using WHERE and ORDER BY clauses.

Many of the queries students write are presented in the context of questions that can be answered through analysis of their query result. This provides teachers with an opportunity to discuss possible interpretations of the data with their students, and encourages further investigation and experimentation to find out the answers to their own questions about each data set.

All of the data we use is linked back to its original source, allowing teachers and students to download it themselves for use in their own applications and assessment tasks.

Relational databases and SQL

Relational databases are one type of database used in many modern applications. Data in a relational database is organised into separate tables that contain records of a similar nature. Each table defines a series of columns that describe the records stored within them, and these records are able to be accessed and updated reliably. Data stored in separate tables can be linked together based on clearly defined relationships, and those relationships allow for flexibility in terms of the presentation, use and maintenance of the data.

SQL is the language of databases; it gives us a way to provide instructions to the computer for accessing, manipulating and analysing our data. An understanding of SQL is critical for developers of almost every kind of data-driven application — everything from websites and games through to voice assistants and calendar tools. Each time you interact with an app or website and the display updates to present you with new information, it’s likely an SQL query was involved.

Want to see it for yourself?

If you’re a teacher, you can access the Introduction to SQL course right now, as well as our other courses on programming and web design, with a free all-access subscription.