Русские видео

Сейчас в тренде

Иностранные видео


Скачать с ютуб How To: Join Vs. Union In MySQL (4 Min) | Learn Inner, Left, Right Joins, Union & Union All в хорошем качестве

How To: Join Vs. Union In MySQL (4 Min) | Learn Inner, Left, Right Joins, Union & Union All 2 года назад


Если кнопки скачивания не загрузились НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием, пожалуйста напишите в поддержку по адресу внизу страницы.
Спасибо за использование сервиса savevideohd.ru



How To: Join Vs. Union In MySQL (4 Min) | Learn Inner, Left, Right Joins, Union & Union All

In this tutorial, you'll learn how to use Join, Inner Join, Left Join, Right Join, Union, Union All In MySQL with examples. — Facebook:   / gokcedbsql   — Video Transcript: — Connect MySQL In Python:    • How To Connect To MySQL In Python (2 ...   — Hi guys, this is Abhi from Gokcedb. In this video, you're going to learn how to use Join and Unions in MySQL.Let's start by looking at the entity relationship diagram. I have four tables in my database right now. However, in this tutorial, I'll mostly be running join and union queries between the property and the cash underscore sales table. The property underscore ID column in the cash underscores sales table is a foreign key and references the ID column in the property table. Say I wanted to select the property name, property size in acres, and property state from the property table and the cash sales price from the cash sales table. To do that, I'll have to specify the inner join keyword and the on keyword to specify the common column between both tables. Here. we can see there are 13 rows where a common value exists between the property and the cash underscore sales table. In other words, there were 13 rows where the property underscore ID column in the cash sales table matches the ID column in the property table. By default, a join is considered an inner join so you really use the inner keyword. As you can see, we got the same number of rows returned without using the inner keyword. When using the inner join, the ordering of the table doesn't matter. For example, if I were to specify the property table on the left side of the join and the cash underscore sales table on the right side of the join. We should still get the same result. However, when using a left or a right join the ordering matters. Let's look at an example. Say in addition to returning the common values, I also wanted to return all the rows from the left table. To do that, just specify the left keyword in front of the join. Note, the left table in this example is the property table because it's specified on the left. As you can see 397 rows were returned which contain the common ID values and all the other rows in the property table. Say we swap the left join keyword with the right join keyword. This time, the cash underscores the sales table on the right which only has 13 records so the output should only be 13 rows. If we were to swap the positions and move the cash underscore sales on the left side of the join and move the property table on the right side of the join then running a right join should return 397 rows instead of 13 rows. You can also restrict the output by specifying a where clause. Say where property size in acres is greater than equal to 40. Replacing the right join with the inner join should further restrict the output to only the rows where the ID exists in both tables. Let's look at the union keyword next. Union is used when you want to combine the results of two or more select queries. Here, I'm selecting two columns from the property table and two columns from the cache underscore sales table. By using the union keyword in the middle, you'll get a result that is the combined output of both queries. By default, the union keyword removes the duplicates from the results. To include the duplicates, replace the union with the union. All note that the select statement should have the same number of columns. See what happens if you try to add an extra column. In the second, select statement you get an error. There you have it. Make sure you like, subscribe, and turn on the notification bell until next time.

Comments