Complete the code to insert a single row into the table named employees.
INSERT INTO employees (name, age) VALUES ([1]);The VALUES clause requires the values for all columns specified, separated by commas and enclosed in parentheses. Here, 'John' is a string and 30 is a number, so the correct syntax is ('John', 30).
Complete the code to insert a single row with columns id and salary into the table payroll.
INSERT INTO payroll (id, salary) VALUES ([1]);Numeric values like id and salary should not be enclosed in quotes. So 101 and 5000 are correct without quotes, and they must be enclosed in parentheses.
Fix the error in the INSERT statement to add a row into the products table with columns product_name and price.
INSERT INTO products (product_name, price) VALUES [1];The VALUES clause must have parentheses around the values separated by commas. Using semicolons or brackets is incorrect syntax.
Fill both blanks to insert a row into the table orders with columns order_id and customer_name.
INSERT INTO orders ([1], [2]) VALUES (102, 'Alice');
The columns to insert into must match the values. Here, 102 is the order_id and 'Alice' is the customer_name.
Fill all three blanks to insert a row into the table students with columns student_id, name, and grade.
INSERT INTO students ([1], [2], [3]) VALUES (201, 'Emma', 'A');
The column names must correspond to the values in order: student_id = 201, name = 'Emma', grade = 'A'.