employer cover photo
employer logo
employer logo

Logistics Health Incorporated

Is this your company?

Logistics Health Incorporated interview question

Write an SQL statement to join 2 tables together

Interview Answer

Anonymous

11 May 2010

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.