Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLite DataType Field Size

Tags:

sql

sqlite

Does SQLite require you to mention field size or are there fixed size for each DataType

ID INTEGER (10)

ID INTEGER
like image 269
chirag7jain Avatar asked Dec 18 '12 09:12

chirag7jain


People also ask

What is the size of INTEGER in SQLite?

The INTEGER values in SQLite are stored in either 1, 2, 3, 4, 6, or 8 bytes of storage depending on the value of the number.

What is the difference between int and INTEGER in SQLite?

However, the dynamic typing in SQLite allows it to do things which are not possible in traditional rigidly typed databases. So in MS Sql Server (for example), an "int" == "integer" == 4 bytes/32 bits. In contrast, a SqlLite "integer" can hold whatever you put into it: from a 1-byte char to an 8-byte long long.

Is there long in SQLite?

The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value. Since long is 8 byte and INTEGER can also save values of 8 bytes, you can use INTEGER .

How do I find the size of a SQLite database?

You can query the database with these two: pragma page_size; pragma page_count; (see the sqlite pragma docs). Multiply the first by the second and you'll get total pages used.


1 Answers

each datatype have fixed size. for more details check http://www.sqlite.org/datatype3.html

like image 160
Pratibha Avatar answered Oct 13 '22 15:10

Pratibha