Q11
True / FalseIn MySQL, a column defined as NOT NULL can never contain a NULL value.
The NOT NULL constraint enforces that a column cannot have a NULL value.
Q12
True / FalseIn MySQL, you can use the IS NULL keyword to check if a value is NULL.
The IS NULL keyword is used to check whether a column contains a NULL value.
Q13
True / FalseIn MySQL, NULL is the same as an empty string or zero.
NULL represents the absence of any value, while an empty string or zero is an actual value.
Q14
True / FalseIn MySQL, using IS NOT NULL in a query filters out all NULL values.
The IS NOT NULL keyword is used to exclude NULL values from the result set.
Q15
True / FalseMySQL's COUNT(*) function counts NULL values in a column.
COUNT(*) counts all rows in a table, including those with NULL values.
Q16
True / FalseIn MySQL, the COALESCE function returns the first non-NULL value from its arguments.
The COALESCE function returns the first non-NULL value in the list of arguments provided.
Q17
True / FalseIn MySQL, the IFNULL function can be used to replace NULL values with a specified value.
The IFNULL function takes two arguments and returns the first argument if it is not NULL, otherwise it returns the second argument.
Q18
True / FalseIn MySQL, an index can be created on columns that contain NULL values.
MySQL allows creating indexes on columns that contain NULL values.
Q19
True / FalseIn MySQL, the NULLIF function returns NULL if the two arguments are equal, otherwise it returns the first argument.
The NULLIF function compares two expressions and returns NULL if they are equal; otherwise, it returns the first expression.
Q20
True / FalseIn MySQL, a column with a default value of NULL will automatically be assigned a value if no value is provided during an insert operation.
If a column has a default value of NULL, it will be assigned a NULL value if no value is provided during an insert operation, not automatically assigned a non-NULL value.
Q26
Multiple ChoiceIdentify the correct SQL statement to create a table with multiple NOT NULL columns.
SQL Code
CREATE TABLE orders (
order_id INT PRIMARY KEY,
customer_id INT NOT NULL,
order_date DATE NOT NULL,
total_amount DECIMAL(10, 2) NOT NULL
);
All specified columns in this table are marked as NOT NULL, ensuring that each must have a value when inserting a new row.
Q30
Multiple ChoiceChoose the correct SQL statement to enforce a NOT NULL constraint on a column during table creation.
SQL Code
CREATE TABLE payments (
payment_id INT PRIMARY KEY,
amount DECIMAL(10, 2) NOT NULL,
payment_date DATE NOT NULL
);
The NOT NULL constraint ensures that both the amount and payment_date columns must always have a value when inserting a new row.