Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to insert a new row into the table.
SQL
INSERT INTO employees (name, age) VALUES ([1], 30);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to use quotes around string values.
Using a number instead of a string for the name.
✗ Incorrect
The value for the name must be a string enclosed in single quotes.
2fill in blank
mediumComplete the code to insert a row with all columns specified.
SQL
INSERT INTO products (id, name, price) VALUES ([1], 'Book', 9.99);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numbers inside quotes when not needed.
Using the wrong data type for the id.
✗ Incorrect
The id is usually a number without quotes, so 1 is correct.
3fill in blank
hardFix the error in the INSERT statement by completing the missing keyword.
SQL
INSERT [1] customers (name, email) VALUES ('Alice', 'alice@example.com');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting INTO keyword.
Using FROM instead of INTO.
✗ Incorrect
The correct syntax is INSERT INTO table_name ...
4fill in blank
hardFill both blanks to insert a new record with specified columns and values.
SQL
INSERT [1] orders (order_id, customer) [2] (101, 'Bob');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using SET instead of VALUES.
Omitting INTO keyword.
✗ Incorrect
Use INSERT INTO to specify the table and VALUES to provide the data.
5fill in blank
hardFill in the blanks to insert multiple rows in one statement.
SQL
INSERT [1] customers (name, age) [2] ('Eve', 28), ('Sam', 35);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using FROM instead of INTO.
Missing VALUES keyword before data.
Trying to use multiple VALUES keywords.
✗ Incorrect
Use INSERT INTO to specify the table, then VALUES followed by multiple sets of data separated by commas.