Database Concepts: Chapter 4 Quiz

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

In most cases, the join condition of an inner join compares the primary key of one table to the _____ key of another table.

foreign

The total number of rows returned by the following query must equal _____. SELECT vendor_name, invoice_number FROM invoices LEFT JOIN vendors ON invoices.vendor_id = vendors.vendor_id

the number of rows in the Invoices table

Like a join, a union combines data from two or more tables. But, instead of combining columns from base tables, a union...

...combines the result set of two or more SELECT statements.

Which of the following is not a reason for using the explicit syntax instead of the implicit syntax for joins? The explicit syntax... a) let's you combine inner and outer joins. b) is easier to read and understand. c) lets you separate the join and search conditions. d) 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 must be based on a column or columns that have the same name in both tables.

A full outer join returns...

...unmatched rows from both the left and right tables.

If you assign an alias to one table in a join, you have to...

...use that alias to refer to the table throughout your query.

In a join, column names need to be qualified only...

...when the same column names exist in both tables.

In most cases, the join condition of an inner join uses the _____ operator to compare two keys.

equal

In a cross join, all of the rows in the first table are joined with all of the...

rows from the second table.

You can combine inner and outer joins within a single _____ statement.

SELECT

When you code a union that combines two result sets, which of the following is not true? a) The corresponding columns in the result sets must have compatible data types. b) Each result set must have the same number of columns. c) The result sets may or may not have any duplicate rows. d) The result sets must be derived from different tables.

The result sets must be derived from different tables.

When you use the implicit syntax for coding joins, the join conditions are coded in the _____ clause.

WHERE

Which of the following is not true about the USING keyword? a) You code a USING clause in addition to the ON clause. b) You use it to simplify the syntax for joining tables. c) It can be used with inner or outer joins. d) 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.

You can simulate a full outer join by using _____.

a union

The "v" in the following example is known as a(n) _____. SELECT vendor_name, invoice_date FROM vendors v JOIN invoices i ON v.vendor_id = vendor_id

alias

In the following query, if the LEFT keyword is replaced with the RIGHT keyword, the total number of rows that are returned must equal: SELECT vendor_name, invoice_number FROM invoices LEFT JOIN vendors ON invoices.vendor_id = vendors.vendor_id a) the number of rows in the Invoices table b) the number of rows in the Vendors table c) the number of rows in the Invoices table plus the number of rows in the Vendors table d) none of the above

none of the above


Set pelajaran terkait

Converting Decimals to Fractions

View Set

KSU Modern Genetics Achieve Homework Study Questions for Final Exam

View Set

LPN A&P chapter 9 Muscular System

View Set

Psychology Chapter 6 Study Guide

View Set