Tables and keys
Bảng dữ liệu và vai trò của Khóa (Primary Key & Foreign Key)
Visualise & Explore
· Trực quan hóa & Tương tácRows, columns and the power of keys (CUSTOMERS & ORDERS)
Dòng, cột và sức mạnh của khóa (CUSTOMERS & ORDERS)
Primary keys identify; foreign keys link — eliminating repeated customer names (P1 · Page 52).
Khóa chính để định danh; khóa ngoại để liên kết — không lặp lại dữ liệu khách hàng (P1 · Trang 52).
Entity-Relationship Topology
Entity Relationships & Cardinality
- CUSTOMERS1 : NORDERS
One customer places many orders via CustomerID foreign key.
Một khách hàng có thể đặt nhiều đơn hàng qua khóa ngoại CustomerID.
CUSTOMERS (CustomerID PK, Name): C-07 Phenikaa Co., C-08 Delta Ltd. -> ORDERS (OrderID PK, CustomerID FK, Date): PO-1042 C-07 03-11, PO-1043 C-07 03-12. Relationship: 1 customer -> N orders.
Understand
· Giải thích khái niệmORDERS: OrderID (PK), CustomerID (FK), Date; PO-1042/C-07/03-11 and PO-1043/C-07/03-12. CUSTOMERS: CustomerID (PK), Name; C-07 Phenikaa Co. and C-08 Delta Ltd. A primary key uniquely identifies a row; a foreign key references the primary key of another table. One customer can have many orders.