If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

SQL: CREATE table with multiple data types

When you create a table, you can specify different data types for the columns. In SQLite, there are various data types that you can specify for each column: INTEGER (a whole number), REAL (floating point number), and TEXT (a string of text). When a column isn't storing any value, it is a NULL value.
If you want to make sure that a particular column value is never NULL, you can type NOT NULL after the data type in the CREATE statement.
SQLite does not have many data types that other SQL engines have, like booleans, dates, and times, but there are approaches for modeling those using the built-in types.
For more details, see the SQLite reference for data types.

Want to join the conversation?

No posts yet.