Blog

python tutorials and learn python

Created with Sketch.

MySQL WEEK Function

MySQL WEEK Function Summary: in this tutorial, you will learn how to use the MySQL WEEK function to get the week number for a date. Introduction to MySQL WEEK function Typically, a year has 365 days for a normal year and 366 days for leap year. A year is then divided into weeks with each…
Read more

MySQL TIMESTAMPDIFF Function

MySQL TIMESTAMPDIFF Function  Summary: in this tutorial, you will learn how to use the MySQL TIMESTAMPDIFF function to calculate the difference between two DATE or DATETIME values. Introduction to MySQL TIMESTAMPDIFF function The following illustrates the syntax of the TIMESTAMPDIFF function. TIMESTAMPDIFF(unit,begin,end); Code language: SQL (Structured Query Language) (sql) The TIMESTAMPDIFF function returns the result…
Read more

MySQL TIMEDIFF Function

MySQL TIMEDIFF Function Summary: this tutorial shows you how to use the MySQL TIMEDIFF function and provides you with some important usage notes of the function. Introduction to MySQL TIMEDIFF function The TIMEDIFF returns the difference between two TIME or DATETIME values. See the following syntax of TIMEDIFF function. TIMEDIFF(dt1, dt2); Code language: SQL (Structured…
Read more

MySQL SYSDATE Function

MySQL SYSDATE Function Summary: in this tutorial, you will learn about the MySQL SYSDATE() function and its caveat. Introduction to MySQL SYSDATE function The following illustrates the syntax of the SYSDATE() function: SYSDATE(fsp); Code language: SQL (Structured Query Language) (sql) The SYSDATE() function returns the current date and time as a value in ‘YYYY-MM-DD HH:MM:SS’ format…
Read more

MySQL Aggregate Functions

MySQL Aggregate Functions Summary: in this tutorial, you will learn about MySQL aggregate functions including AVG COUNT, SUM, MAX and MIN. Introduction to MySQL aggregate functions An aggregate function performs a calculation on multiple values and returns a single value. For example, you can use the AVG() aggregate function that takes multiple numbers and returns…
Read more

MySQL STR_TO_DATE() Function

MySQL STR_TO_DATE() Function Summary: in this tutorial, we will show you how to use the MySQL STR_TO_DATE() function to convert a string into a date time value. Introduction to MySQL STR_TO_DATE function The following illustrates the syntax of the STR_TO_DATE() function: STR_TO_DATE(str,fmt); Code language: SQL (Structured Query Language) (sql) The STR_TO_DATE() converts the str string…
Read more

MySQL MONTH Function

MySQL MONTH Function Summary: in this tutorial, you will learn how to use the MySQL MONTH function to get the month of a given date. Introduction to MySQL MONTH function The MONTH function returns an integer that represents the month of a specified date value. The following illustrates the syntax of the MONTH function: MONTH(date);…
Read more

MySQL NOW Function

MySQL NOW Function Summary: in this tutorial, you will learn about the MySQL NOW() function and apply the NOW function in various contexts. Introduction to MySQL NOW() function The MySQL NOW() function returns the current date and time in the configured time zone as a string or a number in the ‘YYYY-MM-DD HH:MM:DD’ or ‘YYYYMMDDHHMMSS.uuuuuu’ format.…
Read more

MySQL LAST_DAY Function

MySQL LAST_DAY Function Summary: this tutorial introduces you to the MySQL LAST_DAY() function and shows you how to apply the LAST_DAY() function in various contexts. Introduction to MySQL LAST_DAY() function The LAST_DAY() function takes a DATE or DATETIME value and returns the last day of the month for the input date. LAST_DAY(date); Code language: SQL…
Read more

MySQL EXTRACT Function

MySQL EXTRACT Function Summary: in this tutorial, you will learn how to use the MySQL EXTRACT() function to extract part of a DATE or DATETIME value. Introduction to the MySQL EXTRACT() function The EXTRACT() function extracts part of a date. The following illustrates the syntax of the EXTRACT() function. EXTRACT(unit FROM date) Code language: SQL…
Read more