Complete the code to create a column that cannot have NULL values.
CREATE TABLE users (id INT, name VARCHAR(100) [1]);
The NOT NULL constraint ensures the column cannot have NULL values.
Complete the code to set a default value for the column 'status'.
CREATE TABLE orders (order_id INT, status VARCHAR(20) [1]);
The DEFAULT constraint sets a default value when no value is provided.
Fix the error in the column definition to correctly set NOT NULL and DEFAULT constraints.
CREATE TABLE products (id INT, price DECIMAL(5,2) [1] DEFAULT 0.00);
The NOT NULL constraint must be explicitly stated to prevent NULLs even if a DEFAULT is set.
Fill both blanks to create a column 'age' that cannot be NULL and has a default value of 18.
CREATE TABLE members (id INT, age INT [1] [2] 18);
Use NOT NULL to prevent NULLs and DEFAULT 18 to set the default age.
Fill all three blanks to create a table with a 'username' column that is NOT NULL, UNIQUE, and has a default value 'guest'.
CREATE TABLE accounts (id INT PRIMARY KEY, username VARCHAR(50) [1] [2] [3] 'guest');
The username column must be NOT NULL, UNIQUE, and have a DEFAULT 'guest' value.