Main content
Course: Unlisted resources area > Unit 2
Lesson 3: SQL documentation- SQL: CREATE table with multiple data types
- SQL: CREATE table with a primary key
- SQL: Specifying DEFAULT values in CREATE TABLE
- SQL: CREATE TABLE with foreign key reference
- SQL: INSERTing values in tables
- SQL: SELECTing rows
- SQL: SELECTing with WHERE conditions
- SQL: Filter with IN
- SQL: SELECT with ORDER BY
- SQL: Transform SELECT results with CASE
- SQL: Filtering with LIKE
- SQL: Using SELECT with LIMIT
- SQL: ROUND and other core functions
- SQL: SELECT with aggregate functions
- SQL: Grouping SELECT results with GROUP BY
- SQL: Using HAVING with GROUP BY
- SQL: JOIN on tables
- SQL: UPDATE and DELETE
- SQL: ALTER TABLE
© 2024 Khan AcademyTerms of usePrivacy PolicyCookie Notice
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.