INT1
Example
Section titled “Example”CREATE TABLE Employees ( ID INT1, Name VARCHAR(30));
INSERT INTO Employees (ID, Name)VALUES (1, 'John Doe');
SELECT * FROM Employees;Output
Section titled “Output”+----+----------+| ID | Name |+----+----------+| 1 | John Doe |+----+----------+Explanation
Section titled “Explanation”In the above example, INT1 is used as a data type to limit the column ID. The INT1 data type in MySQL represents a very small integer that can store numbers from -128 to 127.
Example
Section titled “Example”CREATE TABLE test (ID INT1);INSERT INTO test (ID) VALUES (5);SELECT * FROM test;Output
Section titled “Output”ID5Explanation
Section titled “Explanation”The above code creates a table test with a column ID of the type INT1. Then it inserts a row with the ID value as 5. Finally, it selects all rows from the table, which is just the one row in this case.