title: How To Make New Columns Based On Multiple Regular Expressions
body: <p>I am trying to select two columns ('column1', 'column2'), filter out by dates in 'column1', and select only the values as per the below regular expressions from column2 in database using a SQL query in Python: </p>
  
  <pre><code>SELECT column1, column2
  FROM data
  WHERE column1 &gt;= '2010-01-01' AND column1 &lt;= '2010-12-01'
  AND (
       column2 REGEXP 'HAPPY' OR
       column2 REGEXP 'JOYFUL' OR
       column2 REGEXP 'BAD'
  )
  """
  </code></pre>
  
  <p>The above code works fine. However, I want to make a new column (say, new_column1) if the regular expression is 'HAPPY' or 'JOYFUL' and make another new column (say, new_column2) if the regular expression is 'BAD'. </p>