liveBook · Manning

Arbitrary-precision integer

As explained in Grokking Relational Database Design

BIGINT is a SQL integer data type designed to represent very large whole-number values.

BIGINT is an integer data type that allocates 8 bytes for whole-number values. It becomes useful when a numeric value may exceed INT's unsigned maximum of 4,294,967,295. section 4.6

Choose an integer type by checking the expected values in the requirements and sample data:

  • Check whether the attribute can be negative; signed values allow negatives, while unsigned values do not. section 4.6
  • Use BIGINT when the value may exceed INT's capacity; smaller types may be insufficient for very large identifiers. section 4.6
  • For a payment_id, BIGINT is large enough, although INT may be sufficient when the expected scale is limited. section 4.6

How Grokking Relational Database Design covers it

How deep it goes
Explains 8-byte storage, signed and unsigned ranges, and a requirements-based selection procedure.
Examples
Uses INT's 4,294,967,295 unsigned maximum and a payment_id attribute to demonstrate datatype selection.
What it assumes
Assumes requirements and sample data are available while teaching integer sizes, ranges, and signedness from the beginning.
What you can do after
Evaluate integer attributes and choose BIGINT or a smaller integer type from expected value ranges.
How it connects
Connects BIGINT with integer data types, signed and unsigned numbers, numeric IDs, and database requirements.

Also explained in

Compare how 4 books explain arbitrary-precision integer →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Relational Database Design. The section links point to the parts of the book it draws on.