1729501056540_SQL_Notes_4
1729501056540_SQL_Notes_4
We must study 7.
YYYY-MM-DD
YYYY-MM-DD HH:MM:SS
1. NOW( ) – returns the current date and time as a value in the format – ‘YYYY-MM-DD
HH:MM:SS’ or ‘YYYYMMDD HHMMSS’ of the system (current time zone) at the time the
command was executed.
** This function does not need any argument value (neither a variable value nor a
column value).
2. DATE(date_expression_time) - returns the date part of the given date value (with
time) or of the date field otherwise current date.
DATE(NOW( ) )
1. NOW( ) = 2021-06-23 12:05:26
Now() returns - Current date + time
2. DATE(NOW( )) = DATE(2021-06-23 12:05:26) = 2021-06-23
Date( ) returns – date part of date_time expression
Write a query to
i. extract date from the given date value – ‘2024-12-12 12:20:06’
ii. show 20 years later year from the current date of your system
2024-06-23
*************