Exam 2 Outcome 4-6 Flashcards
for table joins, the join condition is found in the ____ clause
WHERE
table joins are usually based on _____ relationships
primary/foreign key
table aliases are found in the _____ clause
WHERE
a table alias replaces the ____ with a ____ in order to simplify column identifications
table name; single letter (or more)
if a column name within the SELECT statement exists in more than one table within the FROM clause, the column bust be _____
further identified by table with the corresponding table alias
tables are improperly joined when there is ____
no join condition placed in the WHERE clause
when tables are improperly joined, a ____ is created
cartesian product
returns every row of data in one table joined to every row of data in the other tables
cartesian product
in cartesian product, the ____ returned is multiplied
number of rows
t or f. users may perform cartesian product on purpose
t
t or f. it doesn’t matter whether you list WHERE clause restrictions before or after join relationships
t
relationship between # of tables and # of join conditions
of tables is always 1 more than # of join conditions
5 types of joins
- cartesian
- equality
- self
- non-equality
- outer
join: useful when doing certain statistical calculations
cartesian join
another name for cartesian join
cross join
join: matches columns on the basis of equality
equality join
join: based on primary/foreign key relationships
equality join
3 other names for equality joins
- equijoin
- inner join
- simple join
join: data in one column of a table has a relationship with another column in the same table
self-join
in self-joins, it is necessary to link the table to itself in order to _____
match data
join: joins 2 or more tables based on a specified column value that doesn’t equal a specified column value in another table
non-equality joins
join: used to see rows that don’t meet the join condition
outer joins
outer join operator
(+)
(+) is used on the join condition in the ____ clause
WHERE
(+) can be placed on ____ of the WHERE clause but not ____
either side; both sides
- outer join rule: a WHERE condition using a column from the outer join table must also include ____
(+) operator
- outer join rule: a WHERE condition containing the (+) operator can’t be combined with another condition using this operator
OR
- outer join rule: this logical operator is usable in place of OR
AND
- outer join rule: a WHERE condition can’t use the ___ condition to compare a column marked with the (+) with an expression
IN comparison
- outer join rule: a WHERE condition can’t compare any column marked with the (+) operator with a ____
subquery
another name for non-equality join
non-equijoin
join: replicates each row from the first table with every row from the second table (displays every possible record combo)
cartesian join
join: creates join by using commonly named or defined columns
equality join
join: joins a table to itself
self-join
join: joins tables when there are no equivalent rows in the tables to be joined (matches values in one column with a range of values in another)
non-equality join
join: includes records of a table in output when there’s no matching record in the other table
outer join
of alternate methods to perform equality joins
3
2 advantages of alternate equality joins
- WHERE clause is used only for row restriction conditions
2. improves script readability
alternate equality join that is most similar to traditional syntax
JOIN ON
alternate equality join that is rarely used due to potential for more than one column name matching between the tables
NATURAL JOIN
alternate equality join where table aliases aren’t required
JOIN USING
only possible alternate syntax for self-joins and non-equality joins
JOIN ON
disadvantage of using the outer join operator (+) on the deficient side of the join condition
can only be placed on one side of one side of one join condition
alternate outer join syntax: right table is deficient
LEFT OUTER JOIN