Skip to content · ⁨コンテンツへスキップ⁩

Tables, keys and relationships · ⁨テーブル、キー、関係性⁩

English

More than one table

Real databases split data across several tables. This lesson uses a small shop with two of them:

  • customer — one row per customer (id, name, city)
  • orders — one row per order (id, customer_id, order_date, total)

Storing the customer's name on every order would repeat it again and again. Keeping customers in their own table stores each one once.

日本語

複数のテーブル

実際のデータベースではデータを複数のテーブルに分割して保持します。このレッスンは、2つのテーブルを持つ小さなショップを例にしています:

  • customer — 每位客户一行(id, name, city)
  • orders — 每笔订单一行(id, customer_id, order_date, total)

注文ごとに顧客の名前を記録すると、同じ情報が繰り返されてしまいます。顧客を独自のテーブルに保持することで、各顧客を一度だけ保存できます。

Handout · ⁨プリント⁩

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP