Proposals for Fixing the table Data

The table data organization has two main problems:

Here are two concrete proposals for organizing the data which address one or both of these problems:

Proposal 1: Linking the Tables

The current orders table repeats the price and weight columns from the catalogue. Instead, it would be better to leave that information in the catalogue table, and have a way to reference into particular rows of the catalogue table from the orders table.

Concretely: replace the description, price, andweight columns in the orders table with an item-id column. Then, when a program needs the price of an item, the item-id can be used to find the appropriate row in the catalogue.

New order table:

name item-id count
Anne 7 1
John 6 5

(these Item-IDs match the contents in the first column of the catalogue as show in the Google Sheet.)

Proposal 2: Create Datatypes

Dispense with the tables entirely, and instead use three datatypes: