Chapter 3.1 Joining Tables (Part 2)

Published on Slideshow
Static slideshow
Download PDF version
Download PDF version
Embed video
Share video
Ask about this video

Scene 1 (0s)

undefined. [Virtual Presenter] Hello everyone and welcome to our meeting. Today we will be discussing an important topic in database management joining tables in MS Access. Our focus will be on various joining methods such as EQUI-JOIN Natural Join and CROSS JOIN. As a higher education teacher I am pleased to guide you through this presentation and provide valuable insights on optimizing your data organization. Let's begin!.

Scene 2 (25s)

[Audio] In this part we will discuss other joining methods in S-Q-L operations on multiple tables. These methods are useful in cases where the INNER JOIN may not be the most suitable option. One of these methods is the EQUI-JOIN which is similar to INNER JOIN but allows for more specific matching criteria. This means it is another way to perform the INNER JOIN operation. It is important to note that both the EQUI-JOIN and INNER JOIN will yield the same result when executed. Now let's examine how the EQUI-JOIN works..

Scene 3 (54s)

[Audio] Moving on to our next topic we will discuss S-Q-L operations on multiple tables. Specifically we will focus on the natural J-O-I-N function. As mentioned natural J-O-I-N works similarly to I-N-N-E-R J-O-I-N but it automatically joins fields with identical names in both tables. However this may not always be successful if there are multiple fields with the same name which can make joining the tables challenging. To resolve this issue the author suggests utilizing natural J-O-I-N and renaming the column name to CLUBNAME. Doing this will ensure a successful join and ease of access to the data. Let us proceed to the next slide to gain a better understanding of this concept..

Scene 4 (1m 43s)

[Audio] Welcome everyone. We will be continuing our discussion on joining tables in S-Q-L operations specifically the use of natural J-O-I-N to combine data from multiple tables. This allows us to retrieve information from both the name and C-L-U-B tables without manual matching. By renaming the name column to CLUBNAME in C-L-U-B and using the natural J-O-I-N function we save time and effort when working with large data sets. Let's dive in and explore the advantages of using S-Q-L operations on multiple tables. Thank you for listening..

Scene 5 (2m 20s)

[Audio] We are on slide 5 out of 14 discussing Chapter 3.1 on joining tables. We will be exploring natural J-O-I-N an S-Q-L operation that combines data from two tables using a common column. The two S-Q-L statements on this slide demonstrate that using natural J-O-I-N yields the same results as an INNER JOIN statement. This can be helpful for organizing and analyzing data from multiple sources. Let's look at the examples and see how this operation can be applied in real-life situations. Moving on to the next slide..

Scene 6 (2m 58s)

[Audio] In this part of our presentation we will be discussing how to join tables using S-Q-L operations. We will focus on self J-O-I-N which is when a table is joined to itself. To help clarify this idea let's examine an example..

Scene 7 (3m 17s)

[Audio] In our discussion we will cover S-Q-L operations involving multiple tables specifically utilizing the aliases s1 and s2. Aliases serve as a means of temporarily giving a table two distinct names in a S-Q-L statement enabling the database management system to treat them as individual tables. Moving on our next topic focuses on the recent advancement in converting carbon dioxide into usable fuels by researchers from the United States and South Korea..

Scene 8 (3m 49s)

To list every student with the names of their corresponding class monitors, we need to perform a self join on the table STUDENT..

Scene 9 (4m 7s)

A teacher wants to identify potential study partners with similar academic performance. They may use the following SQL statement to select the names and scores of pairs of students from the table STUDENT where the difference between their test scores is less than 16:.

Scene 10 (4m 31s)

[Audio] Welcome back to Chapter 3.1 Joining Tables (Part 2). Here we will delve further into S-Q-L operations involving multiple tables. One of the things we will cover is an S-Q-L statement that creates duplicate pairs of a student with themselves as demonstrated with "Ada & Ada". To prevent this we can use the criterion s1.sid < s2.sid to eliminate self-pairing and duplicate pairs when using other joining methods. So let's proceed to the next slide and gain a deeper understanding of this criterion..

Scene 11 (4m 55s)

To remove self-pairing and duplicated pairs, we may add the criterion s1.sid < s2.sid.

Scene 12 (5m 13s)

[Audio] In our last session we discussed how to join two tables using S-Q-L operations. However there are situations where we may need to join more than two tables. This can make things more complex but no need to worry because we're here to assist you. Let's take a look at these three tables as an example. Each table contains unique data that we may need to combine to get a complete understanding. This is where joining multiple tables becomes useful. By utilizing S-Q-L operations we can join these tables using a common key or column. This grants us access to data from all three tables in a single query saving time and simplifying the data analysis process. Therefore joining tables in S-Q-L is not limited to only two tables. With the proper knowledge and techniques we can easily join multiple tables and manipulate the data as required. Keep practicing and feel free to ask for assistance when needed..

Scene 13 (6m 12s)

SELECT s. SID, JOIN LEFT LEFT JOIN s . NAME, c. NAME AS CLUBNAME SC ON SC. SID s. SID CLUB c ON c. CID SC. CID FROM STUDENT s.

Scene 14 (6m 25s)

[Audio] In the previous slides we discussed the different types of J-O-I-N operations used in S-Q-L--. Now let's take a closer look at CROSS JOIN. Unlike other J-O-I-Ns CROSS JOIN does not require a foreign key to join on. It simply matches every single row of the left table with every single row of the right table. This can be useful when we want to get all possible combinations of data from two tables. For example... And that concludes our presentation on joining tables in SQL. I hope you found it informative and helpful. Thank you for your attention and have a great day..