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

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))");
echo " $i <br> ";
echo " Not able to add data ";


Download SQL dump file of this table


Post your comments , suggestion , error , requirements etc here .

SQL Video Tutorials

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