Blog

python tutorials and learn python

Created with Sketch.

MySQL DAYOFWEEK Function

MySQL DAYOFWEEK Function The DAYOFWEEK function returns the weekday index for a date i.e., 1 for Sunday, 2 for Monday, … 7 for Saturday. These index values correspond to the ODBC standard. The following illustrates the DAYOFWEEK function: DAYOFWEEK(date) Code language: SQL (Structured Query Language) (sql) The DAYOFWEEK function accepts 1 argument which is a…
Read more

MySQL DAYNAME Function

MySQL DAYNAME Function  Summary: in this tutorial, you will learn how to use the MySQL DAYNAME function to get the name of a weekday for a given date. Introduction to MySQL DAYNAME function MySQL DAYNAME function returns the name of a weekday for a specified date. The following illustrates the syntax of the DAYNAME function: DAYNAME(date);…
Read more

MySQL DATE_FORMAT Function

MySQL DATE_FORMAT Function Summary: in this tutorial, you will learn how to use the MySQL DATE_FORMAT function to format a date value based on a specific format. Introduction to MySQL DATE_FORMAT function To format a date value to a specific format, you use the DATE_FORMAT function. The syntax of the DATE_FORMAT function is as follows:…
Read more

MySQL DATE_SUB Function

MySQL DATE_SUB Function Summary: in this tutorial, you will learn how to subtract a time value from a date using the MySQL DATE_SUB() function. Introduction to MySQL DATE_SUB function The DATE_SUB() function subtracts a time value (or an interval) from a DATE or DATETIME value. The following illustrates the DATE_SUB() function: DATE_SUB(start_date,INTERVAL expr unit) Code…
Read more

MySQL DATE_ADD Function

MySQL DATE_ADD Function Summary: in this tutorial, you will learn how to use MySQL DATE_ADD function to add a time value to a DATE or DATETIME value. Introduction to MySQL DATE_ADD function The DATE_ADD function adds an interval to a DATE or DATETIME value. The following illustrates the syntax of the DATE_ADD function: DATE_ADD(start_date, INTERVAL…
Read more

MySQL DAY Function

MySQL DAY Function Summary: in this tutorial, you will learn how to use the MySQL DAY() function to get the day of the month of a specified date. Introduction to MySQL DAY() function The DAY() function returns the day of the month of a given date. The following shows the syntax of the DAY function:…
Read more

MySQL DATEDIFF Function

MySQL DATEDIFF Function Summary: in this tutorial, you will learn how to use the MySQL DATEDIFF function to calculate the number of days between two date values. Introduction to MySQL DATEDIFF function The MySQL DATEDIFF function calculates the number of days between two  DATE,  DATETIME, or  TIMESTAMP values. The syntax of the MySQL DATEDIFF function…
Read more

MySQL CURDATE Function

MySQL CURDATE Function Summary: in this tutorial, you will learn how to use the MySQL CURDATE() function to get the current date. Introduction to MySQL CURDATE function The CURDATE() function returns the current date as a value in the ‘YYYY-MM-DD’ format if it is used in a string context or YYYMMDD format if it is…
Read more

MySQL Date Functions

MySQL Date Functions This page shows you the most commonly used MySQL Date functions that allow you to manipulate date and time data effectively. Function Description CURDATE Returns the current date. DATEDIFF Calculates the number of days between two DATE values. DAY Gets the day of the month of a specified date. DATE_ADD Adds a…
Read more

The Essential Guide To MySQL ISNULL Function

The Essential Guide To MySQL ISNULL Function Summary: this tutorial introduces you to the MySQL ISNULL function and how to use it to handle NULL values. Introduction to MySQL ISNULL function The ISNULL function takes one argument and tests whether that argument is NULL or not. The ISNULL function returns 1 if the argument is…
Read more