Overview
A table has columns (properties) and rows (records). Each column has a data type. Each row is one instance.
On this page7 sections
The idea
A table is a grid of data inside a database. Columns run vertically and define the properties being stored (order_id, price, status, date). Rows run horizontally, and each row is one record (one order, one customer, one payment). Together, columns and rows form the structure that makes data queryable.
Every column has a data type that controls what values it can hold. VARCHAR stores text (like names or order IDs). INTEGER stores whole numbers (like quantities). DECIMAL or FLOAT stores numbers with decimal points (like prices). TIMESTAMP stores dates and times. BOOLEAN stores true/false values.
Why this exists
Data types are the first line of defense for data quality. If a column is defined as INTEGER, the database will reject the text value 'hello'. This prevents bad data from entering your tables. If you try to add two text strings that happen to look like numbers, the result will be wrong unless the column type is numeric.
Understanding tables, rows, and columns is essential because every SQL query operates on this structure. SELECT chooses which columns to return. WHERE filters which rows to keep. GROUP BY creates buckets of rows. All SQL thinking starts with: what does one row represent?
Picture this
Each row is one order. Each column is one property. The data type determines what operations are valid.
Choose the right type for each column so the database enforces quality automatically.
| Data type | What it stores | Example values | Common operations |
|---|---|---|---|
| VARCHAR / TEXT | Text strings | 'ORD-001', 'paid', 'laptop' | LIKE, CONCAT, TRIM, LENGTH |
| INTEGER / BIGINT | Whole numbers | 4, 1000, 0 | SUM, AVG, +, -, *, / |
| DECIMAL / FLOAT | Numbers with decimals | 19.50, 3.14, 0.08 | SUM, ROUND, >, < |
| TIMESTAMP / DATE | Dates and times | '2026-08-01 10:15:00' | DATE_TRUNC, EXTRACT, -, BETWEEN |
| BOOLEAN | True or false | true, false | AND, OR, NOT, CASE WHEN |
The keyword DESCRIBE (or SHOW COLUMNS) lets you inspect a table's column names and types without looking at the data itself. This is often the first thing a data engineer does when exploring a new dataset.
A small example
Run the example below in this tab. Read the input, follow the code, then check the output matches what you expect.
DESCRIBE orders;After DESCRIBE, pick the columns you need. SELECT * is fine while learning. In production, naming columns makes reviews easier and avoids pulling fields you never use.
SELECT order_id, order_total
FROM orders
LIMIT 5;Common beginner questions
What does one row represent?
This is the most important question in data engineering. In the orders table, one row is one order. In the payments table, one row is one payment. In the ecommerce_events table, one row is one click or page view. This concept is called the 'grain' of the table.
Can a column have missing values?
Yes. Missing values are represented as NULL in SQL. NULL is not zero, not an empty string, not false. It means 'unknown' or 'not recorded'. You will learn how to handle NULLs in a later lesson.
NULL is not zero
A NULL price does not mean the product is free. It means the price was not recorded. Treating NULL as zero in calculations will give wrong results.
What comes next
In the next lesson, you will learn about primary keys and foreign keys: the columns that uniquely identify rows and connect tables to each other.
Practice
Run Sample to see the column names and types of the orders table with DESCRIBE orders. Then complete Exercise: select only order_id and order_total from orders, limited to 5 rows.