Best join approaches
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 01:18 PM
What are some of the best join approaches that we need to be aware of?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 01:50 PM
Do you mean in SQL terms?
Inner join if you want the intersection from both the tables (commonly used)
Left/Right join if you want to converse data from one table but only get the common ones from other
Full Join, you preserve data from both the tables. All the records that are not common will have Nulls populated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 03:22 PM
A couple of things to keep in mind with join, Inner joins can be "dangerous" since they can drop data, so always make sure your using the correct keys. Avoid Right joins when possible. Also think about the relationship of the tabes, 1-1, 1 to many and many to many.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 04:09 PM
This fully depends on the table size and business logic, every case are different. For example, you don’t want to do left join when right table is way smaller than left one.