Đang chuẩn bị liên kết để tải về tài liệu:
Phát triển web với PHP và MySQL - p 21

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Designing Your Web Database CHAPTER 7 175 The relational database term for this relationship is foreign key. CustomerID is the primary key in Customers, but when it appears in another table, such as Orders, it is referred to as a foreign key. You might wonder why we chose to have two separate tables—why not just store Julie’s address in the Orders table? We’ll explore this in more detail in the next section. Schemas The complete set of the table designs for a database is called the database schema. It is akin to a blueprint for the database. A schema should show the tables along. | Designing Your Web Database 175 Chapter 7 The relational database term for this relationship is foreign key. CustomerlD is the primary key in Customers but when it appears in another table such as Orders it is referred to as a foreign key. You might wonder why we chose to have two separate tables why not just store Julie s address in the Orders table We ll explore this in more detail in the next section. Schemas The complete set of the table designs for a database is called the database schema. It is akin to a blueprint for the database. A schema should show the tables along with their columns the data types of the columns and indicate the primary key of each table and any foreign keys. A schema does not include any data but you might want to show sample data with your schema to explain what it is for. The schema can be shown as it is in the diagrams we are using in entity relationship diagrams which are not covered in this book or in a text form such as Customers CustomerID Name Address City Orders OrderID CustomerlD Amount Date Underlined terms in the schema are primary keys in the relation in which they are underlined. Dotted underlined terms are foreign keys in the relation in which they appear with a dotted underline. Relationships Foreign keys represent a relationship between data in two tables. For example the link from Orders to Customers represents a relationship between a row in the Orders table and a row in the Customers table. Three basic kinds of relationships exist in a relational database. They are classified according to the number of things on each side of the relationship. Relationships can be either one-to-one one-to-many or many-to-many. A one-to-one relationship means that there is one of each thing in the relationship. For example if we had put addresses in a separate table from Customers there would be a one-to-one relationship between them. You could have a foreign key from Addresses to Customer or the other way around both are not required

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.