title: How to check if a date is a specific day in the week in MySQL?
body: <p>I have a MySQL table <code>presence</code> with following structure:</p>
  <ul>
  <li>id: 1</li>
  <li>uid: 14</li>
  <li>start: 2021-11-01 00:00:00</li>
  <li>end: 2021-12-31 00:00:00</li>
  <li>repetitive: 1</li>
  </ul>
  <p>This row gives me the information, that the user 14 is present every Monday from 2021-11-01 to 2021-12-31.</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT 1
  FROM presences
  WHERE 2021-11-15 BETWEEN DATE(`start`) AND DATE(`end`)
  </code></pre>
  <p>checks if the given date (2021-11-15) is between his presence dates but how can I add logic to check for &quot;every Monday&quot;? Additionally, if <code>end</code> is null, it should check for every Monday in future without end.
  Monday is given by <code>start</code> date and can be every other day as well.
  <code>repetitive</code> gives me to check that given day by <code>start</code>. If <code>repetitive</code> is 0, it should just check like my query already does, if the date is between <code>start</code> and <code>end</code>.</p>
  <p>Human query: get all rows from <code>presence</code> table where given date is between start and end (if end is not null) and where given day is day of start.</p>