Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Numerical data types
Integer data types
Floating point data types
9. Floating point numbers – calculations
Decimal data types
Summary

Instruction

Excellent! You can also use math and logical operators with double precision and real columns. If we only wanted to show people who weigh 80 kg or less, we could write the following:

SELECT
  *
FROM body
WHERE weight <= 80;

Simple, isn't it?

Exercise

Peter got feedback from his users. They complain that weight without height tells them nothing! After all, it's not extraordinary for a man 2 meters tall (6 ft 7 in) to weigh 85 kg (187 lbs). But the same weight on a man of 1.60 meters (5ft 3 in) is quite different!

In our table body, we now have three columns: user_id, weight, and height. Select all the information about users for whom the weight/height ratio is lower than 0.5.

Stuck? Here's a hint!

Use the condition:

WHERE (weight/height) < 0.5;