From the course: Learning SQL Programming

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Ask for data across two or more tables

Ask for data across two or more tables - SQL Tutorial

From the course: Learning SQL Programming

Start my 1-month free trial

Ask for data across two or more tables

- [Instructor] One advantage of working with databases is that we can use data for more than one table to answer a query. Of course, you can work with data across many spreadsheets using a lookup function, and in a database, to accomplish the same thing, we use the join keyword. There are a few kinds of joins, a few different ways of using join to attach data together. But we'll just look at one in this video, the inner join, which is often just called a join. The idea behind a join is that we're asking for pieces of data or records that somehow associate with each other, that connect or correlate in some way by way of some common piece of information that we tell the database to match up from one table to the next. For example, this diagram shows how we might join the people and states tables using the state code and the state abbreviation as that common piece of information. In one table, I have information about some people, and in another table, called states, I have information…

Contents