Recall & Review
beginner
What is the ENUM data type in MySQL?
ENUM is a string object that can have only one value chosen from a list of allowed values defined when the column is created.
Click to reveal answer
beginner
How does the SET data type differ from ENUM in MySQL?
SET allows storing zero or more values from a predefined list, meaning multiple values can be stored in one column, unlike ENUM which stores only one.
Click to reveal answer
intermediate
What happens if you try to insert a value not listed in an ENUM column?
MySQL inserts an empty string ('') as a special error value if the inserted value is not in the ENUM list.
Click to reveal answer
advanced
How are ENUM and SET values stored internally in MySQL?
ENUM values are stored as numeric indexes representing the position in the list. SET values are stored as bitmaps where each bit represents a possible value.
Click to reveal answer
intermediate
Can you add new values to an ENUM or SET column after the table is created?
Yes, but you must use ALTER TABLE to modify the column definition to include new allowed values.
Click to reveal answer
Which MySQL data type allows storing multiple values from a predefined list in a single column?
✗ Incorrect
SET allows multiple values from a list; ENUM allows only one.
What value does MySQL store if you insert an invalid ENUM value?
✗ Incorrect
MySQL stores an empty string ('') as a special error value for invalid ENUM inserts.
How are ENUM values stored internally in MySQL?
✗ Incorrect
ENUM values are stored as numeric indexes representing their position in the list.
Which statement is true about SET columns?
✗ Incorrect
SET columns can store multiple values chosen from the predefined list.
To add a new allowed value to an ENUM column, you should:
✗ Incorrect
You must use ALTER TABLE to add new values to ENUM or SET columns.
Explain the difference between ENUM and SET types in MySQL and give an example use case for each.
Think about how many values you want to store in one column.
You got /4 concepts.
Describe how MySQL stores ENUM and SET values internally and why this matters for performance.
Consider how numbers and bits are faster to process than strings.
You got /4 concepts.