67 107
Assignments Done
99,3%
Successfully Done
In November 2018

Answer to Question #52632 in Other Programming & Computer Science for Makinon

Question #52632
A database table called PERSON contains the fields NAME, BASIC and HRA. Write a computer program to print a report with employee name and total salary for those employees whose total salary is more than 10,000. Total Salary = BASIC + HRA. At the end, the program should also print the total number of employees whose total salary is
more than 10,000.
Expert's answer
Code (MySQL).
SELECT * FROM PERSON
WHERE BASIC + HRA > 10000;
Code(PHP).
$sql = " SELECT *FROM PERSON WHERE BASIC + HRA > 10000";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
echo$result->num_rows . " results";
while($row = $result->fetch_assoc()) {
        echo"Name: " . $row["NAME"]. "Basic: " . $row["BASIC"]
. " " . $row["HRA"] . "<br>";
    }
} else {
    echo "0 results";
}
 


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions