Grade 12 · Databases & SQL · SQL lab · about 18 minutes
Open this task in the Delphi workspace →
Action queries change the data instead of asking about it — so in Delphi they run with ExecSQL, never Open.
INSERT INTO tblLearners (LearnerID, FirstName, …)
VALUES (13, 'Enzokuhle', …)
UPDATE tblLearners
SET ClassCode = 'B'
WHERE LearnerID = 3
DELETE FROM tblLearners
WHERE ITMark < 50
Two survival rules:
- The VALUES must match the field list one for one, in order — quotes on text, none on numbers.
- An UPDATE or DELETE without a WHERE hits every row in the table. In an exam that is marks gone; in real life it is a career highlight you do not want. Always write the WHERE first.
After each Run the DBGrid shows the table's new state, and the row count tells you exactly what your query touched.