4 Quiz
You can simulate a full outer join by using a left outer join a self join a union the ON clause
A union
In most cases, the join condition of an inner join compares the primary key of one table to the BLANK key of another table.
Foreign
A union combines the rows from two or more BLANK.
Select statements
Which is not true about the USING keyword? you code a USING clause in addition to the ON clause you use it to simplify the syntax for joining tables it can be used with inner or outer joins the join must be an equijoin, meaning the equals operator is used to compare the two columns
You code a USING clause in addition to the ON clause
A table BLANK can be used when you want to assign a temporary name to a table.
alias
???Code example 4-2 SELECT vendor_name, invoice_number FROM invoices LEFT JOIN vendors ON invoices.vendor_id = vendors.vendor_id (Refer to code example 4-2.) The total number of rows returned by this query must equal the number of rows in the Invoices table the number of rows in the Vendors table the number of rows in the Invoices table plus the number of rows in the Vendors table none of the above
the number of rows in the Invoice table
If you assign an alias to one table in a join, you have to qualify every column name in the query assign them to all of the tables use that alias to refer to the table throughout your query qualify all of the column names for that table
use that alias to refer to the table throughout your query
Code example 4-1 SELECT vendor_name, invoice_date FROM vendors v JOIN invoices i ON v.vendor_id = i.vendor_id (Refer to code example 4-1.) The "v" in this example is known as a/an BLANK.
Alias
In most cases, the join condition of an inner join uses the BLANK operator to compare two keys.
Equal
In a join, column names need to be qualified only when the same column names exist in both tables in outer joins in inner joins when the code is confusing
when the same column names exist in both tables
???Code example 4-2 SELECT vendor_name, invoice_number FROM invoices LEFT JOIN vendors ON invoices.vendor_id = vendors.vendor_id (Refer to code example 4-2.) If the LEFT keyword is replaced with the RIGHT keyword, the total number of rows that are returned must equal the number of rows in the Invoices table the number of rows in the Vendors table the number of rows in the Invoices table plus the number of rows in the Vendors table none of the above
NOT the number of rows in the vendors table NOT The number of rows in the invoice table plus the number of rows in the vendors table
Like a join, a union combines data from two or more tables. But, instead of combining columns from base tables, a union by default, does not eliminate duplicate rows is coded in the ORDER BY clause combines the result sets of two or more SELECT statements combines columns from the same table
Combined the result set of two or more SELECT statements
You can combine inner and outer joins within a single BLANK statement.
Select
When you use the implicit syntax for coding joins, the join conditions are coded in the BLANK clause.
Where
????Code example 4-1 SELECT vendor_name, invoice_date FROM vendors v JOIN invoices i ON v.vendor_id = i.vendor_id (Refer to code example 4-1.) This join is coded using the BLANK syntax.
explicit
Code example 4-1 SELECT vendor_name, invoice_date FROM vendors v JOIN invoices i ON v.vendor_id = i.vendor_id (Refer to code example 4-1.) This type of join is called a/an BLANK join.
inner
In a cross join, all of the rows in the first table are joined with all of the unmatched columns in the second table matched rows in the second table rows from the second table distinct rows in the second table
rows from the second table
A full outer join returns rows in the right table that don't satisfy the join condition rows in the left table that don't satisfy the join condition unmatched rows from both the left and right tables the Cartesian product of the two tables
unmatched rows from both the left and right tables
Which of the following is not a reason for using the explicit syntax instead of the implicit syntax for joins? The explicit syntax lets you combine inner and outer joins is easier to read and understand lets you separate the join and search conditions is an older syntax that works with legacy code
Is an older syntax that works with Legacy code
When you use the USING keyword for a join the join can't be an outer join the join can't be done on more than one column the join must be based on a column or columns that have the same name in both tables the join must be an inner join
The join must be based on a column or columns that have the same name in both tables
When you code a union that combines two result sets, which of the following is not true? The corresponding columns in the result sets must have compatible data types. Each result set must have the same number of columns. The result sets may or may not have any duplicate rows. The result sets must be derived from different tables.
The result set must be derived from different tables