Last answered:

29 Mar 2023

Posted on:

29 Mar 2023

0

Which table and column to extract ?

1)How do we decide which Table is table 1 and which table, we will be used for table 2. In this video. departments manager_dup is a Table 2. 

2) How we decide which column we want to extract from both table. Why we choose 2 columns for table 1, why don't we take all the columns that includes from_date and to_date ?

1 answers ( 0 marked as helpful)
Instructor
Posted on:

29 Mar 2023

0

Hi Aina!
Thanks for reaching out.


1) It depends on the task. The order does not matter in inner joins, only in outer joins (left, right and so on). The difference in the speed is negligible as there is always a difference in the speed even if you run the same query again and again without changing it. So, you have to decide according to the task, what exactly result set you want to obtain.

2) It depends on the task. This is not so important because it is simply how you display the result set. The logic of the query is the important part.


Hope this helps.
Best,
Tsvetelin

Submit an answer