Complete the code to select rows where the condition is TRUE in three-valued logic.
SELECT * FROM employees WHERE active IS [1];In SQL three-valued logic, to check if a condition is true, use IS TRUE.
Complete the code to select rows where the condition is UNKNOWN in three-valued logic.
SELECT * FROM orders WHERE shipped_date IS [1];In SQL, IS UNKNOWN checks if the condition evaluates to unknown (NULL).
Fix the error in the WHERE clause to correctly filter rows where the condition is FALSE.
SELECT * FROM products WHERE discontinued IS [1];To filter rows where a condition is false in three-valued logic, use IS FALSE.
Fill both blanks to complete the query that selects rows where the condition is either TRUE or UNKNOWN.
SELECT * FROM customers WHERE status IS [1] OR status IS [2];
This query selects rows where status is either TRUE or UNKNOWN, using IS TRUE and IS UNKNOWN.
Fill all three blanks to create a CASE expression that returns 'Yes', 'No', or 'Unknown' based on a three-valued logic condition.
SELECT CASE WHEN approved IS [1] THEN 'Yes' WHEN approved IS [2] THEN 'No' ELSE [3] END AS approval_status FROM applications;
The CASE expression checks if approved is TRUE or FALSE, returning 'Yes' or 'No'. Otherwise, it returns 'Unknown'.