INSERT OR REPLACE INTO FavoredReligions
       (LeaderType,                                    ReligionType)
SELECT      ('LEADER_ANT_WU_ZETIAN'),                                      ('RELIGION_BUDDHISM')
WHERE NOT EXISTS (SELECT * FROM Religions WHERE ReligionType = 'RELIGION_B1_MAHAYANA');

INSERT OR REPLACE INTO FavoredReligions
       (LeaderType,                                    ReligionType)
SELECT      ('LEADER_ANT_WU_ZETIAN'),                                      ('RELIGION_B1_MAHAYANA')
WHERE EXISTS (SELECT * FROM Religions WHERE ReligionType = 'RELIGION_B1_MAHAYANA');

CREATE TRIGGER VictoriaHR
AFTER INSERT ON Religions WHEN 'RELIGION_ZOROASTRIANISM' = NEW.ReligionType
BEGIN
   INSERT OR REPLACE INTO FavoredReligions
          (LeaderType,                                    ReligionType)
   SELECT      ('LEADER_ANT_WU_ZETIAN'),                                      ('RELIGION_BUDDHISM')
   WHERE NOT EXISTS (SELECT * FROM Religions WHERE ReligionType = 'RELIGION_B1_MAHAYANA');

   INSERT OR REPLACE INTO FavoredReligions
          (LeaderType,                                    ReligionType)
   SELECT      ('LEADER_ANT_WU_ZETIAN'),                                      ('RELIGION_B1_MAHAYANA')
   WHERE EXISTS (SELECT * FROM Religions WHERE ReligionType = 'RELIGION_B1_MAHAYANA');
END;