While we were working at Indibits, on a project, we had a small requirement. We had to calculate all sign ups so far in this week. And our week starts from Saturday. I wanted to do it all in one shot. A single, short and optimized MySQL query which will return the count of all valid sign ups happened at or after 12 AM on last Saturday. And if today is Saturday, then we consider today as the date. But the problem was, how to get date of last Saturday? In PHP, it is almost easy. But in MySQL it was looking bit difficult. But when I started finding the solution, then I realized, it’s more difficult than I estimated. But I applied my logic and found a good and optimized solution in just 12 minutes.