CREATE TABLE - Data types
When creating a new table, we need to specify the
data type for each column we want there to exist in the table. A
data type is simply a specification of what kind of data is stored in that column. Take a look at the
CREATE TABLE statement below.
In the statement,
id stores an integer,
age store text data,
resume stores a file, and
graduationPercetage stores decimal values. The data types against them show similar values.
Here are a few valid data types in
SQLITE, the database this course runs on.
|INTEGER||Stores values that are integer in nature|
|REAL||Stores floating point numbers/decimal numbers|
|TEXT||Stores character data|
|BLOB||Stores binary large objects, like files|
|NULL||When the data type is not clear|
Other databases like
PostgreSQL have many similar to this and many other data types, sometimes many specializations of a single kind like
TEXT. For example,
BIGINT as different variations for
TEXT for various kinds of texts.