SQL
Database Basics
Learn about tables, rows, columns, and keys.
By TechCoder TeamLast updated: 2026-06-02
In a Nutshell
Learn about tables, rows, columns, and keys. This hands-on tutorial focuses on practical implementation of database basics concepts.
Database Basics
In a Relational Database (RDBMS), data is stored in tables.
Tables, Rows, and Columns
- Table: A collection of related data held in a table format within a database. It consists of columns and rows.
- Row (Record): A single, implicitly structured data item in a table. It represents a single entity.
- Column (Field): A set of data values of a particular simple type, one value for each row of the database.
Example: Users Table
| ID | Name | Age | |
|---|---|---|---|
| 1 | Alice | alice@example.com | 25 |
| 2 | Bob | bob@example.com | 30 |
In this example:
- The whole grid is the Table.
- "2, Bob, bob@example.com, 30" is a Row.
- "Email" is a Column.
Primary Key
A Primary Key is a unique identifier for a record in a table. In the example above, ID is likely the primary key because every user has a unique ID.
Foreign Key
A Foreign Key is a field (or collection of fields) in one table that refers to the Primary Key in another table. It establishes a link between data in two tables.
Schema
The Schema is the skeleton structure that represents the logical view of the entire database. It defines how data is organized and how the relations among them are associated.