From 071374ca02ef5ea6b0a3f4c0b8734a4811041412 Mon Sep 17 00:00:00 2001 From: Jeevankumar S <110320697+Jeevankumar-s@users.noreply.github.com> Date: Wed, 14 Jan 2026 15:50:02 +0530 Subject: [PATCH] fix(curriculum): clarify error when inserting without columns (#65133) Co-authored-by: Jeevankumar-S --- .../687ea8a88c9e9419af7cd8c3.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/curriculum/challenges/english/blocks/lecture-working-with-relational-databases/687ea8a88c9e9419af7cd8c3.md b/curriculum/challenges/english/blocks/lecture-working-with-relational-databases/687ea8a88c9e9419af7cd8c3.md index 752fc86d51b..2d5b1b76f65 100644 --- a/curriculum/challenges/english/blocks/lecture-working-with-relational-databases/687ea8a88c9e9419af7cd8c3.md +++ b/curriculum/challenges/english/blocks/lecture-working-with-relational-databases/687ea8a88c9e9419af7cd8c3.md @@ -47,7 +47,11 @@ INSERT INTO dogs VALUES ('Gino', 3); ``` -This is valid too, but it's more prone to errors because the values are assigned to the columns based on their order. +This syntax is valid SQL, but it is error-prone. + +Since values are assigned based on column order, PostgreSQL will try to insert `'Gino'` into the `id` column, which expects an integer. This results in an error such as `invalid input syntax for type integer`. + +For this reason, it is safer to explicitly specify the column names when inserting data. You can also insert multiple records in the same SQL command by separating them with a comma.