This advanced SQL exercise is part of the book: Advanced SQL – Practical Techniques and Use-Cases, which includes 100 day-to-day SQL challenges (and solutions), need-to-know advanced features, and key concepts.

Create a query that displays all dates for the year 2015.
For each day of the year 2015, the query will display an indication (0 or 1), specifying whether it is:

  • Beginning of the week
  • Weekend
  • Beginning of the quarter
  • End of the quarter
  • Beginning of the month
  • End of the month

Would you like to read more?