Skip to main content

Joining Tables

Joining tables is one of the most common operations in data transformation. Visitran's No-Code UI makes it easy to combine data from multiple tables using various join types.

Overview

Table joins allow you to combine rows from two or more tables based on related columns. This is essential when your data is spread across multiple tables and you need to bring it together for analysis.

Join Types Supported

Inner Join

Returns only rows that have matching values in both tables.

Use When: You only want records that exist in both tables.

Left Join (Left Outer Join)

Returns all rows from the left table and matching rows from the right table. Non-matching rows from the right table will have NULL values.

Use When: You want all records from your primary table, with supplementary data from another table when available.

Right Join (Right Outer Join)

Returns all rows from the right table and matching rows from the left table. Non-matching rows from the left table will have NULL values.

Use When: Similar to left join, but prioritizing the right table.

Outer Join (Full Outer Join)

Returns all rows from both tables, with NULL values where matches don't exist.

Use When: You want to see all data from both tables, regardless of matches.

How to Join Tables in Visitran

Step-by-Step Instructions

  1. Select Your Model - Navigate to the model where you want to add a join
  2. Add Join Operation - Click the "Add Join" button in the operations panel
  3. Select Tables - Choose the tables you want to join
  4. Choose Join Type - Select the appropriate join type (Inner, Left, Right, or Outer)
  5. Specify Join Conditions - Define the columns to match between tables
  6. Preview Results - View the joined data in the data grid
  7. Save - Apply the changes to your model

Join Conditions

Join conditions specify how rows from different tables should be matched. Common join conditions include:

  • Equality - Matching on equal values (e.g., orders.customer_id = customers.id)
  • Multiple Conditions - Joining on multiple columns for complex relationships
  • Composite Keys - Using combinations of columns as join keys

Common Use Cases

Customer Orders Analysis

Join customer information with order data to analyze purchasing behavior.

customers (LEFT JOIN) orders
ON customers.id = orders.customer_id

Product Details

Combine product catalog with inventory and pricing information.

products (INNER JOIN) inventory
ON products.sku = inventory.sku

Complete Transaction History

Merge all transaction data even when some information might be missing.

transactions (OUTER JOIN) refunds
ON transactions.id = refunds.transaction_id

Best Practices

  1. Choose the Right Join Type - Understand your data relationships to select the appropriate join
  2. Optimize Join Columns - Use indexed columns for better performance
  3. Check for Duplicates - Be aware that joins can create duplicate rows if relationships aren't one-to-one
  4. Preview Data - Always preview your results to ensure the join produces expected output
  5. Document Relationships - Add comments explaining why specific join types were chosen

Performance Considerations

  • Index Join Columns - Ensure columns used in join conditions are indexed
  • Filter Before Joining - Apply filters to reduce the amount of data being joined
  • Avoid Cartesian Products - Always specify join conditions to prevent unintentional cross joins
  • Consider Join Order - Start with smaller tables when possible

Troubleshooting

No Results After Join

  • Verify join conditions are correct
  • Check for data type mismatches
  • Ensure data exists in both tables

Too Many Results

  • Check for duplicate keys in either table
  • Verify join conditions match your intended relationship
  • Consider using DISTINCT to remove duplicates

NULL Values

  • Review your join type - NULLs are expected with outer joins
  • Check data quality in source tables
  • Consider using COALESCE to handle NULLs

Detailed screenshots showing the join interface will be added soon.