Search code examples
sqloraclealgebra

Relational Algebra and SQL Oracle


I need to output data from one table but only if that customers name has shown up in another table and I'm not quite sure how get this to work. Thanks


Solution

  • You can use an INNER JOIN which will return all rows that appear in both tables:

    select t1.*
    from table1 t1
    inner join table2 t2
      on t1.name = t2.name
    

    If you need help learning JOIN syntax, then here is a great visual explanation of joins