Database Structure
SQL Basics Course
Topic 3: Database Structure
Learn how data is organized inside relational databases using tables, rows, columns, records, fields, and schemas.
Learning Objectives
- Understand database structure
- Learn tables, rows and columns
- Understand records and fields
- Learn database schemas
- Visualize how information is stored
What is a Table?
A table is the primary storage structure in a relational database. It stores related information in rows and columns.
| ID | Name | City |
|---|---|---|
| 1 | Rahul | Delhi |
| 2 | Amit | Mumbai |
What is a Row?
A row represents one complete record inside a table.
Row Example → (1, Rahul, Delhi)
Every row contains information about one entity.
What is a Column?
A column represents a specific attribute of the data.
| Column Name | Description |
|---|---|
| ID | Student Identifier |
| Name | Student Name |
| City | Student City |
What is a Field?
A field is a single value stored at the intersection of a row and a column.
Name Column + Rahul Row = Field Value "Rahul"
What is a Record?
A record is a complete collection of fields describing one item.
| ID | Name | City |
|---|---|---|
| 1 | Rahul | Delhi |
The entire row above is a record.
Understanding Schema
A schema is the blueprint of a database. It defines tables, columns, relationships and constraints.
Database Schema
Students Table
ID | Name | City
How Data is Organized
Database
↓
Tables
↓
Rows & Columns
↓
Fields & Records
Real World Example
| Employee ID | Name | Department | Salary |
|---|---|---|---|
| 101 | John | IT | 50000 |
| 102 | Sarah | HR | 45000 |
This single table contains multiple records, columns, and fields.
Best Practices
- Use meaningful table names
- Use clear column names
- Avoid duplicate data
- Keep schema organized
- Plan relationships early
Practice Exercises
- Define a table.
- What is the difference between a row and a column?
- What is a field?
- What is a record?
- Explain schema in your own words.
Quiz
1. What stores related data in a database?
2. What is a complete row called?
3. What is a single cell value called?
4. What is the blueprint of a database?
5. Are columns attributes or records?
Summary
- Tables store related information.
- Rows represent records.
- Columns represent attributes.
- Fields contain individual values.
- Schemas define database structure.