pow()

We can get power of any number by using pow() function in MySQL
SELECT POW( 5, 2 )
Output of this is
25
For negative
select pow( 4,-2);
Output is
0.065

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
for($i=1; $i<=10; $i++){
$sql=$dbo->prepare("insert into sql_pow(a,b) values($i,pow($i,2))");
if($sql->execute()){
echo " $i <br> ";
}
else{
echo " Not able to add data ";
}

}


Download SQL dump file of this table


SQL Math References COS() SIN() function DEGREES() to convert redian to degee
Subhendu Mohapatra — author at plus2net
Subhendu Mohapatra

Author

🎥 Join me live on YouTube

Passionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.



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-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer