0
0
MySQLquery~10 mins

INSERT INTO single row in MySQL - 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 single row into the table named 'students'.

MySQL
INSERT INTO students (name, age) VALUES ([1]);
Drag options to blanks, or click blank then click option'
A'John', 20
B'John'
CJohn, 20
D(John, 20)
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around string values.
Not using parentheses around the values.
2fill in blank
medium

Complete the code to insert a new product with id 101 and name 'Pen' into the 'products' table.

MySQL
INSERT INTO products (id, name) VALUES ([1]);
Drag options to blanks, or click blank then click option'
A101, 'Pen'
B101, Pen
C'101', 'Pen'
D(101, 'Pen')
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numeric values inside quotes unnecessarily.
Missing quotes around string values.
3fill in blank
hard

Fix the error in the INSERT statement to add a user with username 'alice' and age 25 into the 'users' table.

MySQL
INSERT INTO users (username, age) VALUES [1];
Drag options to blanks, or click blank then click option'
A'alice', 25
Balice, 25
C['alice', 25]
D('alice', 25)
Attempts:
3 left
💡 Hint
Common Mistakes
Using square brackets instead of parentheses.
Not using any parentheses around values.
4fill in blank
hard

Fill both blanks to insert a new employee with id 5 and name 'Emma' into the 'employees' table.

MySQL
INSERT INTO employees ([1]) VALUES ([2]);
Drag options to blanks, or click blank then click option'
Aid, name
Bname, id
C5, 'Emma'
D'Emma', 5
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the order of columns and values.
Not quoting string values.
5fill in blank
hard

Fill all four blanks to insert a new book with id 12, title 'SQL Basics', and price 29.99 into the 'books' table.

MySQL
INSERT INTO books ([1]) VALUES ([2], [3], [4]);
Drag options to blanks, or click blank then click option'
Aid, title, price
B'SQL Basics'
C12
D29.99
Attempts:
3 left
💡 Hint
Common Mistakes
Not matching the number of columns and values.
Forgetting quotes around string values.