liveBook · Manning

Smallint

SMALLINT is a SQL integer data type for storing signed whole numbers in a relatively small, implementation-defined range.

How 3 Manning books explain it

ScyllaDB in Action

SMALLINT is a signed ScyllaDB integer type with a larger range than TINYINT.

How it is used
Stores bounded whole numbers and compact numeric bucket identifiers in ScyllaDB schemas.
How deep it goes
Explains the 16-bit range, compares neighboring integer types, demonstrates queries, and weighs SMALLINT against DATE for buckets.
Examples
Uses CQL insertion and selection of 10000, range validation, and month-based article-summary buckets.
What you can do after
Apply SMALLINT in CQL schemas and choose it for compact buckets after checking range, storage, and readability requirements.

Read how ScyllaDB in Action explains smallint →

100 SQL Server Mistakes and How to Avoid Them

SMALLINT is a SQL Server integer data type that stores signed whole-number values using two bytes.

How it is used
Uses SMALLINT to size SQL Server whole-number columns according to expected values and storage impact.
How deep it goes
Explains range and byte size, demonstrates DATALENGTH, and applies the choice to keys without detailing overflow behavior.
Examples
Demonstrates byte measurement and SMALLINT EmployeeID and ManagerID columns in an Employees table.
What you can do after
Evaluate integer-column ranges and storage consequences before selecting SMALLINT instead of a wider type.

Read how 100 SQL Server Mistakes and How to Avoid Them explains smallint →

Grokking Relational Database Design

SMALLINT is a small SQL integer data type with an implementation-defined fixed storage size and numeric range.

How it is used
Uses SMALLINT when identifying integer attributes whose expected values fit its capacity.
How deep it goes
Defines two-byte storage and signedness, then stops short of specifying an exact numeric range.
Examples
Uses payment_id and a galaxy-wide online store to compare TINYINT, SMALLINT, INT, and BIGINT.
What you can do after
Evaluate integer attributes and choose a type by comparing expected values with available capacity.

Read how Grokking Relational Database Design explains smallint →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.