A few weeks after the latest useful quiz, I want to offer a funny
one.
Given the following table, on a MySQL server 5.1.22 or
newer,
CREATE TABLE t1 (id int, c char(100)) engine=MyISAM;
- Create one set of three triggers that must all be activated
BEFORE INSERT.
- Upon insertion of the values (1, 'nothing'), the first trigger should replace 'nothing' with 'something', leaving the number unchanged;
- the second trigger should add ' more ';
- the third trigger should add '!!'.
- Create one set of three more triggers, all activated BEFORE
INSERT.
- Upon insertion of the values (1,'nothing') the first trigger should add 10 to the number, leaving the text unchanged.
- the second trigger should add 100 to the number;
- the …