Complete the code to set a default value of 0 for the column 'score'.
CREATE TABLE results (id INT, score INT [1] 0);
The keyword DEFAULT is used to specify a default value for a column in SQL.
Complete the code to add a new column 'status' with default value 'active'.
ALTER TABLE users ADD COLUMN status VARCHAR(10) [1] 'active';
When adding a column with a default value, use the DEFAULT keyword followed by the value.
Fix the error in the code to set a default date of '2024-01-01' for the 'start_date' column.
CREATE TABLE events (id INT, start_date DATE [1] '2024-01-01');
The correct keyword to specify a default value is DEFAULT. Using SET or VALUE causes syntax errors.
Fill both blanks to create a table with a 'quantity' column defaulting to 1 and a 'status' column defaulting to 'pending'.
CREATE TABLE orders (quantity INT [1] 1, status VARCHAR(20) [2] 'pending');
Use DEFAULT to set default values for both columns.
Fill all three blanks to add a column 'priority' with default 5, a column 'category' with default 'general', and a column 'active' with default TRUE.
ALTER TABLE tasks ADD COLUMN priority INT [1] 5, ADD COLUMN category VARCHAR(15) [2] 'general', ADD COLUMN active BOOLEAN [3] TRUE;
Use DEFAULT for all three columns to specify their default values.