Logistics Health Incorporated Interview Question: Write an SQL statement to joi... | Glassdoor

Interview Question

Business Data Analyst Interview La Crosse, WI

Write an SQL statement to join 2 tables together


Interview Answer

1 Answer


The answer depends on the DB schema, but the gist of it is, if you have TableA with columns C1, C2, and C3 and TableB with columns C4, C5, and C6, and you want to make sure that your join returns only the rows where the values in TableA.C3 are equal to the values in TableB.C5, then the join will look like this:

SELECT * FROM TableA JOIN TableB ON (TableA.C3 = TableB.C5);

That's about as generic as it can be, There are several different kinds of joins and syntaxes, but this is the idea.

AlexUtiug on May 10, 2010

Add Answers or Comments

To comment on this, Sign In or Sign Up.