4. What does a relationship look like? One record in the Student Table is related to one record in the Participation Table Relationship established between two tables
5.
6.
7.
8. Diagram of Primary & Foreign Keys 5.02 Understand queries, forms, and reports.
9.
10.
11.
12.
13.
14.
Notas del editor
5.01 Database Relationships
5.01 Database Relationships
5.01 Database Relationships Since the database information is associated, the database can pull all the information together whenever you want in ways that you specify. Examples of separate types of data (paragraph 1) In the recycling club database, member contact information is stored separately from lists of recycling volunteers or holiday planning data. Example of associated data (paragraph 2) Recycling club member Nancy Davolio’s name is associated with, or “knows about,” Nancy Davolio’s contact information, which is stored in another set of data. Creating a relational database means you can quickly pull information together. For example, you can quickly print a list of who's volunteered to recycle newspapers this Saturday, along with their up-to-date addresses and phone numbers.
5.01 Database Relationships
5.01 Database Relationships
5.01 Database Relationships Discuss why Last name and first name are not valid primary key fields.
5.01 Database Relationships A detailed example of how primary keys and foreign keys work Let’s say you have a Grocery Products table and an Orders table. The ISBN number is the primary key for the Grocery Products table and a foreign key for the Orders table. The Orders table has its own primary key, the Order ID number. When Nancy Davolio takes an order, her Employee ID number is entered into the Orders table. This ID number refers to the details about Nancy in the Employees table, so there's no need to repeat data about Nancy (such as her phone extension) in the Orders table. We’ll go into more detail about primary keys, foreign keys, and table relationships later in the presentation.
The primary key of the Grocery Products table (ISBN) is linked to the foreign key of the Purchase Orders table (ISBN). The primary key of the Purchase Orders table (Order No.) is linked to the primary key of the Orders table. The foreign key of the Orders table (Store ID) is linked to the primary key of the Customers table.
5.01 Database Relationships
5.01 Database Relationships One-to-many example : A list of suppliers for the music store is contained in Table A. It is linked by the supplier ID field to Table B which contains all of the products used by the music store. When Table B is searched for a specific product (record), such as a CD carrying case, the manager can view the supplier’s contact information, which is stored in Table A. Many-to-Many example : In the music store database, Table A contains customer information and Table B contains CD inventory. A record for Bob from Table A may be linked to several records of CDs in Table B by linking the Customer ID fields. If Table B contains the CD inventory, a record for a particular CD can be linked to several customers in Table A.
5.01 Database Relationships One-to-many example : A list of suppliers for the music store is contained in Table A. It is linked by the supplier ID field to Table B which contains all of the products used by the music store. When Table B is searched for a specific product (record), such as a CD carrying case, the manager can view the supplier’s contact information, which is stored in Table A. Many-to-Many example : In the music store database, Table A contains customer information and Table B contains CD inventory. A record for Bob from Table A may be linked to several records of CDs in Table B by linking the Customer ID fields. If Table B contains the CD inventory, a record for a particular CD can be linked to several customers in Table A.