MySQL BIGINT is a data type that represents an integer value with a range of -9223372036854775808 to 9223372036854775807. It takes 8 bytes of storage space and can be used for storing large numbers such as primary keys or timestamps.
Some examples of how to use BIGINT in MySQL are:
- Creating a table with a BIGINT column:
CREATE TABLE my_table (
id BIGINT PRIMARY KEY,
timestamp BIGINT
);
- Inserting values into a table with a BIGINT column:
INSERT INTO my_table (id, timestamp) VALUES (1234567890123456789, UNIX_TIMESTAMP());
- Querying data from a table with a BIGINT column:
SELECT * FROM my_table WHERE id = 1234567890123456789;