title: How to calculate employees working hours in sql
body: <p>My company business hour is 7:30 to 18 and 13:00 to 15:00 is lunch time.
  Important part is about lunch time that should not calculate as working time of employee at all.</p>
  <ul>
  <li>So imagine employee start working at 8:30 and exit at 15:00 so the time of 4:30 hours should be calculate for him. actually I want to remove lunch time from attendance time of employee in different situations:</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/QQsZx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QQsZx.png" alt="enter image description here" /></a></p>
  <p>My fields are all  in Time(7) format in Sql.</p>