SQL Joins

There are many types of Join statements that allow you to retrieve data from two or more tables based on logical relationships between those tables. For instance, let's say you have a Students and Classes table in a database used by a local college, and each of the tables has a field named StudentID. By using a join statement, you can converge the two tables in a SQL query into one result set. For the most part, a Join condition needs two things:

  • To specify a column from each table to be joined; typically it's a primary key/foreign key relationship

  • A logical operator to be used when comparing values from the specified columns (such as Column A = Column B)

Take a look at the following example illustrating how to use a Join. This example ...

Get Programming Data-Driven Web Applications with ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.