×

MySQL POW() function

In this context, we will learn how we can use the MySQL POW() function with proper syntax and good examples.

Introduction of MySQL POW() function

This function in MySQL is used to return a result after raising a specified exponent number to a mentioned base number.

For example, if the base is 5 and the exponent is 2, this will return a result of 25.

Syntax of the MySQL POW() function

The syntax of the MySQL POW() function is given as follows:

SELECT POW(P, Q);

Parameters or arguments used in MySQL POW() function:

There are two parameters accepted by the POW() function in MySQL, which are given as follows:

P: It is the mentioned base number.

Q: It is the mentioned exponent number.

Returns:

It will return a result after raising a specified exponent number to a specified base number.

Application used for POW() function:

The POW() function can be used in the given below MySQL versions.:

  • MySQL 5.7
  • MySQL 5.6
  • MySQL 5.5
  • MySQL 5.1
  • MySQL 5.0
  • MySQL 4.1
  • MySQL 4.0
  • MySQL 3.23

Examples of MySQL POW() function:

Now we will look into some MySQL POW() function examples and will explore how we can use the POW function in MySQL.

Example 1:

Here, we will derive the result of 64 for the base value 8 and exponent value 2 using the POW function in MySQL.

SELECT POW(8, 2);

Output:

64
1 row in set (0.00 sec)

Example 2:

Here, we will derive the result of 4 for 2 as the base and exponent value using the POW function in MySQL.

SELECT POW(2, 2);

Output:

4
1 row in set (0.00 sec)

Example 3:

Here, we will derive the result of 1 for the base value 6 and exponent value 0 using the POW function in MySQL.

SELECT POW(6, 0);

Output:

1
1 row in set (0.00 sec)

Example 4:

Here, we will derive the result of 0 for the base value 0 and exponent value 4 using the POW function in MySQL.

SELECT POW(0, 4);

Output:

0
1 row in set (0.00 sec)

Application of MySQL POW() function:

This function is used to return a result after raising a specified exponent number to a specified base number.

Summary:

In the above context, we have learned how to use the POW() function in MySQL to return a result after raising a specified exponent number to a mentioned base number.


Related Topics

MySQL LOG10() function

In this context, we will learn how we can use the MySQL LOG10() function with proper syntax and good examples. Introduction of MySQL LOG10() function To evaluate the natural logarithmic value of...

2 minutes read.

MySQL Database Introduction

MySQL - Database Introduction: The database plays an essential role in MySQL for storing and modifying the data. The database creates and keeps multiple tables. The database organizes and manipulates...

8 minutes read.

MySQL INSERT() Function

In this context, we will learn how we can use the MySQL INSERT() function with proper syntax and good examples. Introduction of MySQL INSERT() function Basically, in MySQL, the INSERT function is...

2 minutes read.

MySQL MAX function

The MAX function is a type of aggregation function that determines the maximum value of the table data. This function works on numerical data type values. If the table displays...

4 minutes read.

MySQL Truncate() Function

In this context, we will learn how we can use the MYSQL TRUNCATE function to truncate a number to a mentioned number of decimal places. Syntax of MySQL Truncate Function A number...

2 minutes read.

MySQL Full text index

Full text index The full-text index in the table isused to search the full text of the data. This index assigns to the table using a "FULLTEXT" keyword. First, the table...

3 minutes read.

MySQL Environmental Setup

The MySQL Environmental Setup MySQL is free, open-source, and cross-platform software, which can be downloaded from its official website. MySQL management system installs on Linux, macOS, and windows. MySQL requires a framework...

6 minutes read.

MySQL Math Function

The math function operates numerical values and displays required number data. The math function finds out sin, cos, tan values. Here, you find out the absolute value, reminder, and logarithmic...

6 minutes read.

MySQL LEAST function

This statement displays the smallest value of the table. The LEAST function returns a null value when the table contains a null value. If the table contains all numerical values,...

2 minutes read.

MySQL Advance function

The advance function operates numerical values, string values, and data types.  The advance function converts, displays, and compares given values as per requirement. Here, you find out database, table, and...

4 minutes read.

MySQL Join

The relational database system needs to interconnect multiple tables with each other. MySQL is a popular and easy data management system to connect multiple tables. The foreign key is used...

5 minutes read.

Clustered vs Non-Clustered Index

Clustered vs. Non-Clustered Index The difference between clustered and non-clustered index is the most famous question in the database-related interviews. Both indexes have the same physical structure and are stored as...

2 minutes read.

MySQL Show index

This query helps to access and retrieve table information. This syntax displays the required index or all indexes of the table. It also displays the index type as per the...

3 minutes read.

MySQL Stored Procedure

MySQL creates the "stored procedure" function to operate database information. You can use parameters, blocks, and statements to create a new procedure. The procedure requires a database table to use...

3 minutes read.

MySQL DAY() function

In this context, we will learn how we can use the MySQL DAY() function with proper syntax and good examples. Introduction of MySQL DAY() function This function in MySQL is used to...

2 minutes read.

MySQL vs Oracle

What is MySQL? The open-source MySQL relational database management system is a vital software component for web-based applications. As the data is saved and sent over the internet, databases and related...

6 minutes read.

MySQL PERIOD_ADD() function

In this context, we will learn how we can use the MySQL PERIOD_ADD() function with proper syntax and good examples. Introduction of MySQL PERIOD_ADD() function In MySQL, PERIOD_ADD() function will help to...

2 minutes read.

MySQL POWER() function

In this context, we will learn how we can use the MySQL POWER() function with proper syntax and good examples. Introduction of MySQL POWER() function The value of a number raised to...

3 minutes read.

MySQL ASIN() Function

In this context we will learn how we can use the ASIN() function in MySQL with proper syntax and good example. Introduction of MySQL ASIN() function The arc sine value of a...

2 minutes read.

MySQL Control flow function

The control flow function uses values or operands for logical operations. These functions can works on single and multiple conditions. The control flow function is based on the Boolean expression....

3 minutes read.