🗃️Column
Also known as Field, Database Column, Attribute
One kind of fact every row holds, like name or price, with a set type.
Think of it like
Think of it like one box on a form, such as Name. Every form has it, and each person fills it in.
Example
Jack adds a phone column to his customers table. Each old row now has an empty phone until he fills it in.
Why it matters
Columns and their types are what keep data clean. A price can never be the word cheap.
Definition
Example code
sql
ALTER TABLE customers ADD COLUMN phone TEXT;Common mistake
Key takeaways
- 1One kind of fact. Name, price or date.
- 2A set type. Wrong values are refused.
- 3Rules too. NOT NULL means never empty.