OneCompiler

Write an SQL query to display the correct message (meaningful message) from input comments_and_translation table.

145
    id INT PRIMARY KEY,
    comment VARCHAR(255),
    translation VARCHAR(255)
);

INSERT INTO comments_and_translations (id, comment, translation) VALUES
(1, 'very good', NULL),
(2, 'good', NULL),
(3, 'bad', NULL),
(4, 'ordinary', NULL),
(5, 'cdcdcdcd', 'very bad'),
(6, 'excellent', NULL),
(7, 'ababab', 'not satisfied'),
(8, 'satisfied', NULL),
(9, 'aabbaabb', 'extraordinary'),
(10, 'ccddccbb', 'medium');


SELECT *
FROM comments_and_translations;


SELECT id, COALESCE(translation, comment) AS message
FROM comments_and_translations;