Skip to content · ⁨Bỏ qua nội dung⁩

Tables, keys and relationships · ⁨Bảng, khóa và mối quan hệ⁩

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.

Tiếng Việt

Nhiều hơn một bảng

Cơ sở dữ liệu thực tế chia sẻ dữ liệu trên nhiều bảng. Bài học này sử dụng một cửa hàng nhỏ với hai bảng:

  • customer — một dòng cho mỗi khách hàng (id, name, city)
  • orders — một dòng cho mỗi đơn hàng (id, customer_id, order_date, total)

Lưu tên khách hàng trong mỗi đơn hàng sẽ khiến nó bị lặp đi lặp lại. Giữ khách hàng trong bảng riêng lưu mỗi người một lần duy nhất.

Handout · ⁨Tài liệu⁩

Log in or create account · ⁨Đăng nhập hoặc tạo tài khoản⁩

IGCSE, A-Level & AP