TINYINT is ScyllaDB’s smallest signed integer type. It stores whole-number values from -128 through 127, making it suitable when a field’s known bounds fit within that range. section 4.2.2
For a restaurant-review application, a review score from 1 to 10 fits naturally in TINYINT. The articles table uses TINYINT for its score alongside TEXT, DATE, and other types. section 4.2.2 section 5.3.1
Use TINYINT when:
- The value is a whole number rather than a decimal. section 4.2.2
- The application can guarantee that values remain between -128 and 127. section 4.2.2
- A compact integer is useful for a bounded field such as a review score or a date bucket. section 4.2.2 section 5.1.3
Review score in an articles table
Define the score column as `score TINYINT` in the articles table. A score such as 6 fits the type; attempting to insert 5000 produces a database error because the value is out of range. section 5.3.1 section 4.2.2
Table 4.4 The four integer types in CQL
|
Type
|
Size
|
Minimum value
|
Maximum value
|
|---|---|---|---|
TINYINT
|
8-bit
|
-128
|
127
|
SMALLINT
|
16-bit
|
-32,768
|
32,767
|
INT
|
32-bit
|
-2,147,483,648
|
2,147,483,647
|
BIGINT
|
64-bit
|
-9,223,372,036,854,775,808
|
9,223,372,036,854,775,807
|
Compare TINYINT’s size and bounds with SMALLINT, INT, and BIGINT before choosing a numeric type. section 4.2.2


