In MySQL, how we can compute date by providing the year, week number and day of the week? day of the week?
Answers
MySQL DATE is one of the five temporal data types used for managing date values. MySQL uses yyyy-mm-dd format for storing a date value. This format is fixed and it is not possible to change it.
For example, you may prefer to use mm-dd-yyyy format but you can’t. Instead, you follow the standard date format and use the DATE_FORMAT function to format the date the way you want.
MySQL uses 3 bytes to store a DATE value. The DATE values range from 1000-01-01 to 9999-12-31. If you want to store a date value that is out of this range, you need to use a non-temporal data type like integer e.g., three columns, and each column for the year, month, and day. You also need to create stored functions to simulate the built-in date functions provided by MySQL, which is not recommended.