I have SQLite database (created in SQLiteStudio).
The DDL is this:
CREATE TABLE player (
player_id INTEGER PRIMARY KEY ASC AUTOINCREMENT
UNIQUE
NOT NULL,
first_nickname STRING (10) NOT NULL,
health INTEGER (100) NOT NULL,
gold INTEGER (99) NOT NULL,
silver INTEGER (99) NOT NULL,
bronze INTEGER (99) NOT NULL,
gerium INTEGER (99) NOT NULL
);
Expected: I shouldn't be able to insert integers higher than 100 into health
column.
What happens: For some reason, I can insert numbers higher than 100
Why was I able to...
INSERT INTO player (first_nickname, health, gold, silver, bronze, gerium) VALUES ('Foo', 101, 0, 0, 15, 0)
...if my health
's column is set to INTEGER with max value of 100?
Why am I able to insert 101 when I should only be able to enter 100?