A
A
Andrey Ivanov2020-10-21 21:32:18
SQLite
Andrey Ivanov, 2020-10-21 21:32:18

What is the best datatype to use for a key in SQL?

The PRIMARY KEY column stores IMEI.
Which datatype is better to choose so that SELECT / UPDATE with WHERE by key is faster??

In fact, you can put INT, since there are only numbers (there will be a large 14 value number).
Can be VARCHAR(14) or TEXT.
Which one will work faster?

And what datatype is better to choose for a column that will store string data, no more than 50 characters long - VARCHAR (50) or TEXT? And are there significant differences between them in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-10-22
@dimonchik2013

2) Varchar
1) integer if IMEI cannot start from zero

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question