SELECT SQRT(16); -- 4
SELECT SQRT(20); -- 4.47213595499958
For a negative argument, SQRT() returns NULL.
SELECT SQRT(-25); -- NULL

H² = A² + B²
H = √(A² + B²)
We will create one UPDATE query by using MySQL pow function.UPDATE sql_sqrt
SET H = SQRT(POW(A, 2) + POW(B, 2));
This will update the table with value of hypotenuse . Here is the PHP code to update the table.
require 'config.php'; // Database connection
$query = 'UPDATE sql_sqrt SET H = SQRT(POW(A, 2) + POW(B, 2))';
$stmt = $dbo->prepare($query);
$stmt->execute();
echo 'Successfully updated H';
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.