title: Mysql Assigning attribute via trigger based on a radius of dates
body: <p>I'm once again asking for your help!</p>
  <p>I have been setting up a database for the first time during these past couple of days, in order to learn mysql. Starting with, from what I have been told a simple platform like a Webshop.</p>
  <p>Now I have made the database with functioning relations, stored procedures some basic triggers like assigning a default roleID to every new customer.</p>
  <p>But now I'm trying to see if it's possible to add a discountID based on the current date being either on or between the start_date AND end_date column attributes.</p>
  <p>For example DiscountID= 'Christmass', Start_date='2022-12-10', End_date = '2022-12-26'.</p>
  <p>My first thought was using a trigger with a IF ELSE.</p>
  <p>But I'm not really sure how to realize this just yet.</p>
  <pre><code> drop trigger if exists before_order;
  DELIMITER $$
  CREATE TRIGGER before_order
      BEFORE INSERT ON orders
      FOR EACH ROW
         BEGIN
              IF  order_date.orders = between Start_date.discounts  AND End_date.discounts
              SET NEW.DiscountID =;
              ELSE 
              SET New.DiscountID= 'No Discount';
          END$$
  DELIMITER ;
  </code></pre>
  <p>Now this doesn't work but might help express what I'm after.</p>
  <p>Any idea's or tips would be much appreciated.</p>