Presentation is loading. Please wait.

Presentation is loading. Please wait.

Joins We will look at joins again this time we will closer examine each join type in detail. We will look at the following join types. a)inner join b)Right.

Similar presentations


Presentation on theme: "Joins We will look at joins again this time we will closer examine each join type in detail. We will look at the following join types. a)inner join b)Right."— Presentation transcript:

1 Joins We will look at joins again this time we will closer examine each join type in detail. We will look at the following join types. a)inner join b)Right outer Join c)Left outer join d)Self Join The examples we will use are Members table which contains record for 24 members, not all who have borrowed books The loans table contains records for 22 loans, some representing different books borrowed by the same members (It also should contain two entries that do not match the members table Definition: A join is the process of combining records from two tables. Inner Join : the most common type of join and is also microsoft access default join. A query returns only records that have matching values in their related fields.

2 Joins

3

4 The query combines all records with matching Mem ID values in the loans and members tables. There are 20 records in the loans table with matching records in the members tables. It ignores the two records in the loans table that have no matching record in the members table, and ignores all records in the members table that have no matching record in the loans table. Left Outer Join : is one in which a query returns all records from the primary table but only matching records from the related tables Go forward one slide The query returns all records from the member table (primary table) that do not have matching records in the loans table. In these records the fields from the loans table are blank.

5 Joins

6 Right Outer Join : is the one which a query returns all records from the related table but only matching records from the primary table Go forward one slide The query combines all records with matching Mem ID value in the loans and Members tables. It also returns the two records from the loans table that do not have matching records in the members table..

7 Joins

8 Self Joins : is the one which a table is joined to itself. This is useful, for example, when you want to find records that have the same values in one or more fields in the same table. Go forward one slide The query returns a list of all members who reside at the same address as another member.

9 Joins

10 Questions Q1 In a query, which join type returns all records from the primary table but only matching records from the related table a)Inner Join b)Left Outer Join c)Right Outer Join Q2 IN a query, which join type returns all records from the related table but only matching records from the primary table? a)Inner Join b)Left Outer Join c)Right Outer Join Q3 Where do you set the default join type for a relationship? a)In the join properties dialog box when creating a query b)In the edit relationships dialog box when creating a relationship in the relationships window c)In the Join properties dialog box when creating a relationship in the relationships window

11 Questions Q4 True or False – you can join two tables in a query even when no relationship has been created between the tables a)True b)False Q5 True or False you can create a permanent relationship between two tables by joining them in a query a)True b)False Q6 Which of the following must be true in order to join two tables in a query? a)The related fields must have the same name b)The related fields must have the same data type c)The related fields must have the same or compatible data type.


Download ppt "Joins We will look at joins again this time we will closer examine each join type in detail. We will look at the following join types. a)inner join b)Right."

Similar presentations


Ads by Google