Complete the code to insert or replace a row in the table.
REPLACE INTO behavior (id, action) VALUES ([1], 'jump');
The REPLACE INTO statement requires a valid primary key or unique key value to identify the row. Here, 1 is a valid id.
Complete the code to replace a row with id 5 and action 'run'.
REPLACE INTO behavior (id, action) VALUES ([1], 'run');
The REPLACE INTO statement will replace the row where id = 5 or insert a new one if it doesn't exist.
Fix the error in the REPLACE statement to update action to 'walk' for id 10.
REPLACE INTO behavior (id, action) VALUES ([1], 'walk');
The id should be a number without quotes if the column type is integer. Using quotes may cause type mismatch.
Fill both blanks to replace a row with id 20 and action 'sit'.
REPLACE INTO behavior ([1], [2]) VALUES (20, 'sit');
The columns to replace must match the values. Here, id and action are the correct columns.
Fill all three blanks to replace a row with id 30, action 'jump', and date '2024-01-01'.
REPLACE INTO behavior ([1], [2], [3]) VALUES (30, 'jump', '2024-01-01');
The columns must match the values in order: id, action, and date.