Complete the code to create an ENUM type named 'mood' with values 'happy', 'sad', and 'neutral'.
CREATE TYPE mood AS ENUM ([1]);The ENUM values must be listed as comma-separated strings enclosed in single quotes.
Complete the code to add a column 'current_mood' of type 'mood' to the 'users' table.
ALTER TABLE users ADD COLUMN current_mood [1];The column type must be the ENUM type 'mood' that was created earlier.
Fix the error in the code to insert a value 'excited' into the 'current_mood' column of 'users'.
INSERT INTO users (current_mood) VALUES ([1]);Only values defined in the ENUM type can be inserted. 'excited' is not defined, but 'happy' is.
Fill both blanks to change the ENUM type 'mood' by adding a new value 'excited' after 'happy'.
ALTER TYPE mood [1] [2] 'excited' AFTER 'happy';
To add a new value to an ENUM type, use 'ADD VALUE'.
Fill all three blanks to select all users whose 'current_mood' is either 'happy' or 'excited'.
SELECT * FROM users WHERE current_mood [1] ('[2]', '[3]');
The 'IN' operator checks if a value matches any in a list. We check for 'happy' and 'excited'.