Loading topic
department_id, and the department's name lives in the departments table. A join recombines those tables at query time. This chapter gives the model you need for the rest of the tutorial: wha6 min readSELECT with WHERE and ORDER BY, and that you know what primary and foreign keys are. You should also know how to alias a table and how NULL behaves in comparisons. The examples use the Oracle HR sample schema, where employees.department_id is a fo6 min readSELECT with WHERE and ORDER BY, and that you know primary keys, foreign keys, table aliases and how NULL behaves in comparisons. It also assumes you have read the chapter on inner joins. The examples use the Oracle HR sample schema (employees, `6 min readSELECT statements with WHERE, that you know what a foreign key is, and that you have met LEFT OUTER JOIN in the previous chapter. You should also know that comparing anything to NULL with = or > yields unknown, not true.6 min read(+) operator. Huge amounts of production SQL still use it: old reports, views, ETL scripts, and code generated by older tools. This chapter assumes you can write an inner join, know what NULL means in a 5 min readON and one in WHERE, and have seen the (+) operator before. The examples use the Oracle HR sample schema (employees, departments, locations).5 min readHR sample schema: employees, departments, locations, countries and job_history.5 min readJOIN ... ON, that you know what NULL means in a comparison, and that you have used table aliases. The examples use the employees and departments tables from the Oracle HR sample schema.7 min readUSING names the columns to join on. NATURAL JOIN finds the columns by itself. Both save typing. Both also change how you can refer to the join columns, and NATURAL JOIN can quietly change what a query means. This chapter covers how each works6 min read= in the join condition. Both use the same ANSI JOIN ... ON syntax you already know.6 min readINNER JOIN ... ON query and read the comma syntax with a join condition in WHERE. It also assumes you know table aliases and how NULL behaves. Here you will learn what a cross join is, why a missing join condition produces one by accident, how to d7 min readHR sample schema. Most join bugs don't raise an error. The query runs and returns the wrong number 6 min read