From the course: Oracle Database 12c: Basic SQL

Unlock the full course today

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

Joining data from tables

Joining data from tables - Oracle Database Tutorial

From the course: Oracle Database 12c: Basic SQL

Start my 1-month free trial

Joining data from tables

- [Instructor] Now it's time for us to write our very first SQL join query. But before doing so, let's understand the type of problems that we're trying to solve using a join statement. So let's say we want to retrieve the first name, last name and the department for each employee in our company. If we type select, first_name comma last_name comma department_id from employees and run our query, we'll get the first name, the last name, and a code representing department id, but not the actual department name. That's because if we select all of the data in our employee's table, we'll see that we do not store department names as part of the records of our employee table, but only department IDs. The actual department names themselves are stored in the department's table. As you can see, we have the department ID, with the corresponding department name. That's because our database schema is normalized meaning that we store department codes for repeating values, such as for employees, in…

Contents