Week 03 · lesson

Lesson 4: Start Thinking Like a Database

A spreadsheet stores rows and columns. A database can store related tables and connect them with rules.

That difference matters because the district course includes database work. Before we touch a database tool, we need the thinking model.

Spreadsheet table versus database table

A spreadsheet table is often one flat list.

Example:

ArtifactCategoryStatusStudent note
Home pageWebsiteReadyfixed links
ChartSpreadsheetDrafttitle weak

A database table is usually one kind of thing.

For a portfolio system, you might separate:

  • artifacts;
  • categories;
  • revisions;
  • sources; or
  • review notes.

Separating information prevents the same facts from being repeated in too many places.

Key vocabulary

Use these words carefully:

  • Entity: a thing the system tracks, such as Artifact or Category.
  • Field: one kind of information about an entity, such as Title or Status.
  • Record: one row in a table.
  • Key: a field that identifies a record.
  • Relationship: a connection between tables.

A database starts with decisions about what things exist and how they connect.

Why relationships matter

Suppose every artifact has a category.

You could type the category name into every artifact row. That works for a small spreadsheet.

But if the category name changes from Media to Media Evidence, every repeated copy must be updated.

A relational design can store categories in one table and refer to them from artifact records.

Lab 4: Sketch a two-table model

Create two simple tables on paper, in a document, or in an approved tool.

Use this starter model:

Table 1: Artifacts

artifact_idartifact_titlecategory_idstatus
A001Home pageC001Ready
A002Chart evidenceC002Revised

Table 2: Categories

category_idcategory_name
C001Website
C002Spreadsheet
C003Presentation

The relationship is:

Artifacts.category_id connects to Categories.category_id

That connection lets the artifact table use a category without rewriting the full category definition every time.

Add two sample records

Add at least two artifact records from your own portfolio or a teacher-supplied sample.

Do not use private student information.

Each artifact record should include:

  • a simple artifact ID;
  • a title;
  • a category ID; and
  • a status.

Explain the relationship

Write a short explanation:

The Artifacts table stores one row per portfolio artifact.
The Categories table stores category names once.
The category_id field connects an artifact to its category.

That explanation is more important than using a fancy tool today.

Evidence checkpoint

Save:

  • the two-table sketch;
  • at least two artifact records;
  • at least three category records;
  • one relationship statement; and
  • one sentence explaining why the two-table model is cleaner than repeating category names everywhere.

This is the first database move. Next, we will make database work more concrete.