Complete the code to return the inserted row's id.
INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com') [1] id;
The RETURNING clause in PostgreSQL returns specified columns from the affected rows after an INSERT.
Complete the code to return all columns after updating a user's email.
UPDATE users SET email = 'new@example.com' WHERE id = 5 [1] *;
The RETURNING * clause returns all columns of the updated row.
Fix the error in the DELETE statement to return the deleted user's name.
DELETE FROM users WHERE id = 10 [1] name;
In PostgreSQL, RETURNING returns columns from deleted rows.
Fill both blanks to return the id and email of the newly inserted user.
INSERT INTO users (name, email) VALUES ('Bob', 'bob@example.com') [1] [2];
The RETURNING clause followed by column names returns those columns from the inserted row.
Fill all three blanks to update a user's name and return the id, name, and email.
UPDATE users SET name = 'Charlie' WHERE id = 7 [1] [2] [3];
Use RETURNING followed by the list of columns separated by commas to get specific columns after UPDATE.