BIGINT
BIGINT is a data type in SQL. It is used to store large numeric values that exceed the limits of other integer types. BIGINT typically accommodates numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. As the largest available numeric type, BIGINT is ideal for data entities with large numeric ranges. However, it should be implemented discerningly due to its substantial storage size requirement.
Example
Output
Explanation
In the provided example, a table named ‘Employees’ is created with two columns: ID and Name. The ID column is declared with BIGINT data type to store large integer values. A new row has been inserted into this table with an ID value of 12345678901234, illustrating the use of BIGINT for large integers.
Example
Output
Explanation
The BIGINT datatype is used to store large numbers. It can store numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. In the example, we have created an Employees table with ID as a BIGINT and Name as TEXT. Then we inserted a row with ID as the maximum value a BIGINT can hold.
Example
Output
Explanation
In this example, a table named Example
is created with two columns: ID
and Name
. The ID
column uses the BIGINT
data type, which can store large integer numbers. A row is inserted into the Example
table with the ID
value is the maximum allowed for a BIGINT
value (9223372036854775807
), and a SELECT *
query is executed to return all row(s) from the Example
table.
Example
Output
Explanation
In this example, a table Employee
is created with two columns: ID
of data type BIGINT
and Name
of data type VARCHAR2(100)
. One record is inserted with ID
as 1234567890123456789
and Name
as John Doe
. The SELECT
statement retrieves all the records from the Employee
table.
Example
Output
Explanation
In the CREATE TABLE
statement, a table called Employees
is generated and the ID
column is declared to be of BIGINT
type which is a large-sized integer. BIGINT
is used when the data to be stored is expected to exceed the storage size of usual integer types. The table also includes NAME
, AGE
and SALARY
columns of types TEXT
, INT
, and DEC
respectively.
Then an INSERT INTO
statement is used to insert values (‘John Doe’, 30, 50000) into the columns of Employees
table where the ID
is 12345678910, exhibiting the purpose of BIGINT
type, capable of storing much larger numbers.
The SELECT * FROM Employees;
statement extracts and shows all records from the Employees
table, as seen in the output.