SQL Keywords

SQL INT1

What does the SQL INT1 data type do?

INT1 is a MySQL-specific alias for the 1-byte integer data type TINYINT, used to store very small whole numbers.
Sign up to get up to date news on SQL keywords
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Compatible dialects for SQL INT1: Supported: MySQL, MariaDB. Not supported: PostgreSQL, SQL Server, Oracle, SQLite, Snowflake, etc.

SQL INT1 Full Explanation

INT1 behaves exactly the same as TINYINT in MySQL and MariaDB. It consumes one byte of storage and can be declared as either SIGNED or UNSIGNED. When SIGNED (default), the range is ‑128 to 127. When UNSIGNED, the range is 0 to 255. INT1 can also be combined with the ZEROFILL attribute, which pads returned values with leading zeros and implicitly adds UNSIGNED. The keyword is non-standard SQL; most other database systems do not recognize it. While still accepted by MySQL, INT1 is considered purely a synonym for TINYINT, so using TINYINT is usually preferred for readability and cross-version compatibility. INT1 participates in numeric expressions like any other integer type, and it follows MySQL’s standard rules for integer overflow, casting, and implicit conversion.

SQL INT1 Syntax

column_name INT1 [SIGNED | UNSIGNED] [ZEROFILL]

SQL INT1 Parameters

  • SIGNED: keyword (optional) - Stores negative and positive values (-128 to 127). Default.
  • UNSIGNED: keyword (optional) - Restricts values to non-negative range (0 to 255).
  • ZEROFILL: keyword (optional) - Pads displayed numbers with leading zeros to the specified display width and automatically applies UNSIGNED.

Example Queries Using SQL INT1

-- Create a table using INT1
CREATE TABLE user_flags (
  is_active INT1 UNSIGNED NOT NULL DEFAULT 0,
  rating INT1 
);

-- Insert sample rows
INSERT INTO user_flags (is_active, rating) VALUES (1, 12), (0, -5);

-- Query the data
SELECT * FROM user_flags;

Expected Output Using SQL INT1

  • The table is created with two columns, each occupying 1 byte of storage per row
  • The INSERT succeeds as long as the values fall within the valid ranges (is_active: 0-255, rating: ‑128-127)
  • The SELECT returns the stored rows

Use Cases with SQL INT1

  • Store Boolean-like flags in a compact, numeric form.
  • Represent small enumerations or status codes that never exceed 255.
  • Save disk space when dealing with very large tables containing millions of rows with tiny integer values.

Common Mistakes with SQL INT1

  • Assuming INT1 is portable to PostgreSQL, SQL Server, or Oracle (it is not).
  • Confusing INT1 with BIT(1); INT1 stores whole numbers, not individual bits.
  • Forgetting that ZEROFILL makes the column automatically UNSIGNED.
  • Expecting INT1 to accept values larger than 255 (UNSIGNED) or 127 (SIGNED).

Related Topics

TINYINT, SMALLINT, INT, BIGINT, UNSIGNED, ZEROFILL

First Introduced In

MySQL 3.23

Frequently Asked Questions

What is the range of INT1?

INT1 uses 1 byte. Signed range: ‑128 to 127. Unsigned range: 0 to 255.

Is INT1 the same as TINYINT?

Yes. In MySQL and MariaDB, INT1 is a direct synonym for TINYINT with identical behavior.

Can I use INT1 in PostgreSQL or SQL Server?

No. INT1 is not part of the SQL standard and is unsupported in most non-MySQL databases.

Does INT1 support ZEROFILL?

Yes. Adding ZEROFILL pads returned numbers with leading zeros and implicitly makes the column UNSIGNED.

Sign up to get up to date news on SQL keywords
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.
Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo

Check out other commonly used SQL Keywords!