Thesnake123
Thesnake123

Reputation: 65

What if you don't specify the datatype of new column in SQLite?

What if you don't specify the datatype of new column

ALTER TABLE celebs 
ADD COLUMN twitter_handle TEXT;  #what if we don't specify it's datatype TEXT?

SELECT * FROM celebs; 

Upvotes: 3

Views: 928

Answers (1)

C Perkins
C Perkins

Reputation: 3886

For sqlite, the type is not required. If no type is specified, the default type affinity will be BLOB. See official documentation for more detail including a table of examples.

Upvotes: 5

Related Questions