J
J
J. Snow2020-08-10 13:49:52
Database design
J. Snow, 2020-08-10 13:49:52

Do fields need to be Unsigned?

We all often store all sorts of non-negative numbers in the database.
Question: Do they UNSIGNED or not?

Let's say there is a table with information about books .
Each book has some positive number of pages .
This number is stored in the database as SMALLINT .
Does it make sense to make this field UNSIGNED?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2020-08-10
@dimonchik2013

well, smallint (for the task of pages) maybe not
int, I’ll definitely
add it - tupanul, in general, smllint is necessary
, for example, you can store port numbers in smallint unsigned, it’s quite enough for a proxy base - there are definitely indexes on ports

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question