MySQL ADD COLUMN Statement with Examples

How to Add Columns to a Table in MySQL In this tutorial, you will learn how to add columns to a MySQL table using the MySQL ADD COLUMN statement, which allows you to add single or multiple columns in a single MySQL statement. If you want to delete the existing columns, use the DELETE COLUMN … Read more

MySQL AVG() Function with Examples

How to Use the MySQL AVG() Function In this tutorial, we’ll learn how to use the AVG() function to calculate the average value of an expression in MySQL. MySQL AVG() Syntax The syntax of the AVG() function is as follows: AGV([DISTINCT] expression) Remarks The expression argument is required, and can be a column name or … Read more

MySQL CREATE USER – Add Users in MySQL

How to create a user account using the CREATE USER statement in MySQL with examples This tutorial explains how to create a user account in MySQL using the CREATE USER statement. It is possible to create a user account that can connect to the MySQL database server from localhost, a specified host, or any host. … Read more

MySQL INSTR Function with Examples

How to Use the MySQL INSTR Function In this tutorial, we’ll learn how to use the MySQL INSTR() function. INSTR() returns the position of the first occurrence of substring in a given string. MySQL INSTR Syntax The following is the syntax of the INSTR() function: INSTR(string, substring) Remark INSTR() returns 0 if substring or string … Read more

MySQL RENAME TABLE Statement with Examples

How to Rename a Table in MySQL In this tutorial, you will learn how to rename a table using the MySQL RENAME TABLE statement. See also: MySQL ALTER TABLE statement RENAME TABLE Syntax To rename a table in MySQL, use the following statement: RENAME TABLE old_table_name TO new_table_name; You can also rename multiple tables at … Read more

MySQL CURDATE() Function with Examples

How to Get the Current Date in MySQL using CURDATE() In this tutorial, you’ll learn how to use the MySQL CURDATE() function. CURDATE() is a function to return the current date. MySQL CURDATE() Syntax The syntax of the CURDATE() function is as follows: CURDATE() Remark This function is equal to the CURRENT_DATE() function MySQL returns … Read more

MySQL DROP USER – Delete Users in MySQL

How to remove user accounts in MySQL with Examples This tutorial explains how to use the DROP USER statement to delete user accounts and their privileges in MySQL. Learn more: How to create users in MySQL DROP USER Syntax The syntax of the DROP USER statement is as follows: DROP USER user [, user] … … Read more

Python return Statement with Examples

How to use the Python return Statement In this tutorial, you’ll learn how to use the Python return statement with examples. What is the return statement in Python? A return statement is a statement that occurs in a function definition used to return a value to a function call. The return Statement Syntax The following … Read more

Python List Methods and Functions with Examples

List Methods and Functions in Python Python has some list methods and built-in functions that you can use on lists. 1. List Methods The following is a list of Python list methods: Method Description append(item) Adds an element to the end of the list ——————————– Example:list = [‘Apple’, ‘Grape’, ‘Melon’]list.append(‘Mango’) extend(iterable) Adds all elements of … Read more

MySQL LENGTH Function with Examples

How to Use the MySQL LENGTH Function In this tutorial, you’ll learn how to use the MySQL LENGTH() function. LENGTH() is a function to return the length of a given string. LENGTH Syntax The syntax of the LENGTH() function is as follows: LENGTH(string) Examples Example 1 The following statement returns the length of the string: … Read more

MySQL FIND_IN_SET() Function with Examples

How to Use the MySQL FIND_IN_SET() Function In this tutorial, you’ll learn how to use the MySQL FIND_IN_SET() function. FIND_IN_SET returns the position of a string within a list of strings. MySQL FIND_IN_SET() Syntax The syntax of the FIND_IN_SET function is as follows: FIND_IN_SET(string, string_list) Arguments String: Required. The string to search for. String_list: Required. … Read more

Python abs() – Absolute Value in Python

How to find the absolute value of a number with the Python abs() function In this tutorial, you will learn how to find the absolute value of a given number using the Python abs() function, which takes one argument and returns the absolute value. Square root in Python Python abs() Function Syntax The syntax of … Read more

Python Factorial – Find the Factorial of a Number

How to Find the Factorial of a Number using factorial() in Python In this tutorial, you’ll learn how to find the factorial of a number using the factorial function in Python. In addition to factorial(), this tutorial also gives you sample programs to find the factorial of a number using recursion, the while loop and for loop statements without recursion. Python factorial() … Read more

MySQL UPDATE Statement with Examples

MySQL-Update-Statement-and-Examples

How to Use an Update Statement in MySQL In this tutorial, you will learn how to use the MySQL UPDATE statement and write SQL queries to update tables in MySQL. To update a table, write the MySQL UPDATE statement as follows: UPDATE table SET column1=value1,column2=value2,…columnN=valueN WHERE where_condition No comma between the last column and a … Read more