Complete the code to add a NOT NULL constraint to the 'name' column.
ALTER TABLE employees MODIFY COLUMN name [1];The NOT NULL constraint ensures the 'name' column cannot have NULL values. The column type must be specified along with NOT NULL.
Complete the code to create a table where 'email' cannot be NULL.
CREATE TABLE users (id INT PRIMARY KEY, email [1]);The NOT NULL constraint on 'email' ensures every user must have an email address.
Fix the error in the code to add a NOT NULL constraint to 'age'.
ALTER TABLE persons MODIFY age [1];The correct syntax requires specifying the data type with NOT NULL to modify the column properly.
Fill both blanks to create a table where 'username' and 'password' cannot be NULL.
CREATE TABLE accounts (username [1], password [2]);
Both 'username' and 'password' columns must have NOT NULL constraints with appropriate data types.
Fill all three blanks to add NOT NULL constraints to 'title', 'author', and 'year' columns.
CREATE TABLE books (title [1], author [2], year [3]);
Each column has a suitable data type with NOT NULL to ensure no missing values.