pow()

We can raise a number to a power with MySQL POW(). POWER() is a synonym for POW().
SELECT POW(5, 2);
Output of this is
25
For negative
SELECT POW(4, -2);
Output is
0.0625

Square table of number 1 to 10

We will develop a code to create square table of 1 to 10. We will be storing the data in mysql table.
Here is the code
require 'config.php'; // Database connection
$stmt = $dbo->prepare(
    'INSERT INTO sql_pow (a, b) VALUES (:a, POW(:base, 2))'
);

for ($i = 1; $i <= 10; $i++) {
    $stmt->execute(['a' => $i, 'base' => $i]);
}


Download SQL dump file of this table


SQL Math References COS() SIN() function DEGREES() to convert redian to degee


Subscribe to our YouTube Channel here



plus2net.com




SQL Video Tutorials










✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer