← Back to GCSE guidesCodeBash GCSE Computer Science← Previous
Databases

SQL Querying

SQL is how you actually ask a database questions. Every clause below updates a real query and a real, live-filtered result, over the same Customers and Orders tables from the design lesson.

Section 2

Build a query, watch it run live

Change any setting below and watch both the SQL text and the highlighted matching rows update immediately.

SELECT

FROM

WHERE

ORDER BY

Section 3

JOIN: combining two tables into one result

This is usually the hardest SQL concept at this level, because it needs both tables at once. A JOIN matches rows using the foreign key link, exactly like the relationship from the design lesson, and produces one combined table you can then filter and sort as normal.

Result: Customers JOIN Orders ON Customers.CustomerID = Orders.CustomerID

Add a WHERE filter to the join

Section 4

Aggregate functions: summarising instead of listing

Sometimes you don't want every row, you want a total, an average, or a count. GROUP BY splits the rows into buckets first, then the aggregate function summarises each bucket separately.

Function

Section 5

INSERT, UPDATE and DELETE

SELECT only ever reads data. These three statements are how a database actually changes.

Orders, before and after
Section 6

Check your understanding