0
0
SQLquery~10 mins

Common INSERT errors and fixes in SQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to insert a new row into the users table with a name and age.

SQL
INSERT INTO users (name, age) VALUES ([1], 30);
Drag options to blanks, or click blank then click option'
A'Alice'
BAlice
C"Alice"
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around text values.
Using double quotes instead of single quotes for text.
2fill in blank
medium

Complete the code to insert a row with all columns in the products table.

SQL
INSERT INTO products VALUES ([1], 'Laptop', 999.99);
Drag options to blanks, or click blank then click option'
A'1'
B1
Cid
DNULL
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numeric values inside quotes.
Not matching the number of values to the number of columns.
3fill in blank
hard

Fix the error in the INSERT statement by completing the missing keyword.

SQL
INSERT [1] users (name, age) VALUES ('Bob', 25);
Drag options to blanks, or click blank then click option'
ATO
BIN
CINTO
DON
Attempts:
3 left
💡 Hint
Common Mistakes
Using TO or IN instead of INTO.
Omitting the keyword after INSERT.
4fill in blank
hard

Fill both blanks to insert a row with only the name column specified.

SQL
INSERT INTO users ([1]) VALUES ([2]);
Drag options to blanks, or click blank then click option'
Aname
B'Charlie'
Cage
D30
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatching columns and values.
Forgetting quotes around text values.
5fill in blank
hard

Fill all three blanks to insert a new product with id, name, and price.

SQL
INSERT INTO products ([1], [2], [3]) VALUES (101, 'Tablet', 299.99);
Drag options to blanks, or click blank then click option'
Aid
Bname
Cprice
Dquantity
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong column names that don't match the table.
Mismatching the order of columns and values.