CodingNic

Databases and Persistence

What is a Database?

Databases and Persistence 10 min read

What is a Database?

What is a Database?

A database is a place where your application stores data so it can be used later.

Think of It Like a Spreadsheet

A database works very similar to a spreadsheet.

Database Table Diagram

It is made up of:

  • Tables
  • Rows
  • Columns

Tables

A table is where data is stored.

For example, you can have a table called users.

Columns

Columns define the type of data stored.

Example columns:

  • id
  • name
  • email

Rows

Rows are individual entries in the table.

Each row represents one record.

Example:

id name email
1 John john@email.com
2 Alice alice@email.com

How This Connects to Your App

In your app:

  • When a user submits their name
  • Instead of losing it
  • You will store it in a table

Later, you can:

  • Show all users
  • Find a specific user
  • Update user data

Key Idea

A database lets your app remember information.

Without it:

  • Data disappears

With it:

  • Data stays

Summary

  • A database stores data
  • Tables hold the data
  • Rows are records
  • Columns define structure

In the next lesson, you’ll set up your first database using SQLite.