From the course: From Excel to SQL

Unlock the full course today

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

Using JOINs

Using JOINs

From the course: From Excel to SQL

Start my 1-month free trial

Using JOINs

- When working with a database, you might find the information you're looking for is spread across multiple tables. And this is pretty common. So let's take a look at how you can ask a question across more than one table? Let's open up DB Browser and view the contents of the departments table using the browse data tab. You can see here that we have an office_manager_id, but what if we want to find out the names of the office managers for each department, names are stored in the employees table. Now the office_manager_id from the departments table is related to the id column in the employees table. And this is important because we can use this relationship to ask the database for the names of the office managers. Let's head over to the execute SQL tab and start our query. To start, we'll ask for the first and last names of each employee and ask for the department name. So to do that, we'll write select first…

Contents