SELECT IF(1 = 2,' true','false');
SELECT IF(1 = 1,' true','false');
SELECT customerNumber, customerName, state, country FROM customers;
SELECT customerNumber, customerName, IF(state IS NULL, 'N/A', state) state, country FROM customers;
SELECT SUM(IF(status = 'Shipped', 1, 0)) AS Shipped, SUM(IF(status = 'Cancelled', 1, 0)) AS Cancelled FROM orders;
SELECT DISTINCT status FROM orders ORDER BY status;
SELECT COUNT(IF(status = 'Cancelled', 1, NULL)) Cancelled, COUNT(IF(status = 'Disputed', 1, NULL)) Disputed, COUNT(IF(status = 'In Process', 1, NULL)) 'In Process', COUNT(IF(status = 'On Hold', 1, NULL)) 'On Hold', COUNT(IF(status = 'Resolved', 1, NULL)) 'Resolved', COUNT(IF(status = 'Shipped', 1, NULL)) 'Shipped' FROM orders;
SELECT status, COUNT(STATUS) FROM orders GROUP BY status