FLOAT4
FLOAT4 in SQL refers to a data type that is used to store floating-point numbers. It allows for single precision floating-point numbers, which means they require 4 bytes of storage and can handle up to 6 digits of precision. It is commonly used when the exact precision of a number is not required.
Example
Output
Explanation
This sample SQL code creates a table named items
with three columns: id
, product
and weight
. The weight
column uses the FLOAT4
data type to store floating-point numbers. Two rows are inserted into the items
table, and then all records from the table
are selected with a SELECT * FROM items
command. The output shows the results of this select query.
Example
Output
Explanation
In the provided example, FLOAT4
data type in Oracle SQL is used to declare a variable num
. The variable is then assigned the value of 12.3456
. The DBMS_OUTPUT.PUT_LINE
function is then used to output the value of num
, resulting in the displayed output. The FLOAT4
data type supports a precision of floating point numbers up to 4 bytes.