275 SQL Flashcards
A full outer join includes rows that satisfy the join condition, plus
Rows in both tables that don’t satisfy the join condition
When applying multiple join conditions (i.e. more than one condition which must be true) to an inner join in explicit syntax, the extra conditions can be applied:
In the WHERE clause and/or the ON section
The basic format for an inner join using explicit syntax is:
SELECT … FROM table1 JOIN table2 ON join_condition
In most cases, the join condition of an inner join compares the primary key of one table to the ____________________ key of another table.
foreign
When performing an inner join using implicit join syntax, you should place the join condition(s):
In the WHERE clause
In a cross join, all of the rows in the first table are joined with…
all rows in the second table
SELECT v.VendorName AS Vendor, i.InvDate AS Date
FROM Vendors v
JOIN Invoices i ON v.VendorID = i.VendorID;
In this example, “i” is known as…
a table alias
Correlation names (aka table aliases) can be specified with the option AS keyword to temporarily re-name a table within the scope of the query. When/how is the best practice for using correlation names?
When they simplify or clarify the query.
Queries combined with UNION must use the same tables to avoid an error.
False
SELECT VendorName, InvoiceNumber
FROM Invoices i
RIGHT JOIN Vendors v ON i.VendorID = v.VendorID;
If the RIGHT keyword is replaced with the LEFT keyword, the query…
keeps unmatched rows in the Invoices tab