Students add rows with INSERT INTO, match values to columns, meet NULL, and check the change with SELECT.
Open these in Waypoints Prepare with one click. To share a file another way, copy its address and paste it into Load URL, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.
Predict and Run 9 min · Investigate 6 min · Modify and Make 10 min
On the slides at these points. Students can do the whole lesson on their own; these are for the room. In the deck, the Run, Modify and Make slides have the live playground in them (the tutorial link is the backup), and the notes above are in each slide's speaker notes.
Students invent a new table for a club sign-up (name, year level, favourite game) and write the INSERT for the person next to them.
Keeping values in column order. Write the column names above the values.
| What you will see | A question to ask | The fix |
|---|---|---|
| UNIQUE constraint failed | Has this id been used already? | Choose an id that is not in the table, or press Reset and run once. |
| table songs has 7 columns but 3 values were supplied | How many columns does the table have? | Give a value for every column, or name the columns you are filling. |
| Text without quotes. | Which values are text? | Text values go in single quotes. Numbers do not. |
One possible solution for each task. Other correct programs are fine.
INSERT INTO songs
VALUES (16, 'Compass', 'Mira Vale', 'pop', 2024, 199, 0);
SELECT title, artist FROM songs WHERE id = 16;
INSERT INTO songs VALUES (16, 'Compass', 'Kito', 'electronic', 2024, 199, 0);
INSERT INTO songs VALUES (17, 'Sparks', 'Mira Vale', 'pop', 2024, 190, 0);
SELECT id, title FROM songs WHERE id > 15;
Stretch: Add a song with a column list that leaves plays out. What does plays hold?
Support: Give the INSERT with one value blank for each task.
What goes in the brackets after VALUES?
One value for each column, in the table's column order, with text in single quotes.
Next lesson: change and remove rows with UPDATE and DELETE, and why WHERE matters.