Values and Data Types
AvailableLesson 1 of 25 · Syntax · Easy
The big idea
SQL is the language used to ask databases for information. Every value in SQL has a type, such as a whole number, a decimal, or text.
Think of it like this: Think of `SELECT` in SQL like asking a helpful librarian a question: `SELECT 5;` simply says, 'Please hand me back the number 5.'
Read the lesson
SQL is the language used to ask databases for information. Every value in SQL has a type, such as a whole number, a decimal, or text.
The simplest SQL statement uses SELECT followed by a value and a semicolon ;:
SELECT 20; -- a whole number
SELECT 9.99; -- a decimal number
SELECT 'Maya'; -- text (wrapped in single quotes)
You do not need a table yet to practice SELECT — just ask SQL for a single value and press Run to see it come back.
Quick check
Which keyword starts almost every basic SQL question?
Your challenge
Write a simple SQL line that asks the database for the number 5 (just type SELECT 5;).
More learning tools(compare languages, visual guide, related lessons)
Compare with another language
Similar to python.variables-types (85% overlap). Variables & primitive types: compare let/const (JS), auto/int (C++), := (Go), let mut (Rust), and column types (SQL).
Visual walkthrough
A diagram, a step-by-step animation, and short captions for Values and Data Types.
Learn this first
Nothing needed - you can start here.