Chapter 5 SQL – Flashcards
Unlock all answers in this set
Unlock answersquestion
True
answer
You can join tables by using a condition in the where clause.
question
True
answer
To ensure that query results are listed in a desired order, use the order by clause.
question
True
answer
It is permissible to quality all column names in a query.
question
False
answer
In small databases, there is a significant time difference between different query approaches.
question
True
answer
One reason for using an alias is simplicity.
question
False
answer
For two tables to be union compatible, the columns of the two tables must be identical.
question
False
answer
MySQL supports the intersect operator.
question
True
answer
When using a DBMS without an optimizer, the formulation of a query can make a difference in the speed with which the query is executed.
question
...
answer
You must join tables on matching columns.
question
False
answer
To produce the same results as the minus operator, use not, the in operator and a sub-query.
question
where
answer
You can join tables by using a condition in the ____ clause.
question
(.)
answer
To quality a column name, precede the name of the column with the name of the table, followed by a ____.
question
in
answer
To retrieve data from multiple tables in a query you can use the ___ operator with a sub-query.
question
exists
answer
You can precede a sub-query with the ___ operator to create a condition that is true if one or more rows are obtained with the sub-query is executed.
question
correlated
answer
What a sub-query involves a table listed in the outer query, the sub query is called a ___ sub-query.
question
select
answer
A ____ clause can include statistics calculated for only the groups or columns whose values are identical for each row in a group.
question
spacebar
answer
You create an alias by typing the name of the table, pressing the ___, and then typing the name of the alias.
question
union
answer
the ____ of two tables is a table containing every row that is in either the first table, the second table, or both tables.
question
intersect
answer
The ____ of two tables is a table containing all rows that are in both tables.
question
...
answer
The ___ of two tables is the set of all rows that are in the first table but that are not in the second table.
question
union
answer
Two tables are ___ compatible if they have the same number of columns and if their corresponding columns have identical data types and lengths.
question
duplicate
answer
For an SQL implementation to truly support the union operation, it must remove ___ rows automatically.
question
minus & intersect
answer
Which of the following set operators are not supported by MySQL?
question
all
answer
If you precede the sub-query by the ___ operator, the condition is true only is it satisfies all values produced by the sub-query.
question
any
answer
If you precede the sub-query by the ___ operator, the condition is true only is it satisfies any values produced by the sub-query.
question
inner
answer
Which of the following joins compares the tables in the from clause and lists only those rows that satisfy the condition in the where clause?
question
full outer
answer
In a ___ join, all rows from both tables are included regardless of whether they match rows from the other table.
question
left outer join
answer
In a ___, all rows from the table on the left will be included regardless of whether they match rows from the table on the right.
question
right outer join
answer
In a ___, all rows from the table on the right will be included regardless of whether they match rows from the table on the left.
question
Cartesian
answer
The product of two tables is formally called the ___ product.
question
join
answer
To retrieve data from more than one table, you mus ____ the tables together by finding rows in the two tables that have identical values in matching columns.
question
qualify
answer
When there is potential ambiguity in listing column names, you must ___ the columns involved in the query.
question
where
answer
You join tables in SQL by including a condition in the ___ clause to ensure that matching columns contain equal values.
question
correlated
answer
The sub-query that involves a table listed in the outer query is called a ___ sub-query.
question
nested
answer
A sub-query within a sub-query is called a ___ sub-query.
question
optimizations
answer
MySQL performs many built-in ___ that analyze queries to determine the best way to satisfy them.
question
alias
answer
When tables are listed in the from clause, you can give each table an ___ or an alternate name.
question
self-join
answer
Joining a table to itself, is called a ____.
question
join
answer
If you had two separate tables for customers and the query requested customers in the first table having the same city as customers in the second table, you could use a normal ___ operation to find the answer.
question
select
answer
In a multiple-table query, you list all the desired columns in the ___ clause and qualify any columns that appear in more than one table.
question
union
answer
The ___ of two tables is a table containing every row that is in either the first table, the second table, or both tables.
question
intersect
answer
The ___ of two tables is a table containing all rows that are in both tables.
question
difference
answer
The ___ of two tables is the set of rows that are in the first table but that are not in the second table.
question
union
answer
Two tables are ___ compatible if they have the same number of columns and if their corresponding columns have identical data types and lengths.
question
rows
answer
If the SQL implementation truly supports the union operation, it will remove any duplicate ___ automatically.
question
all
answer
If you precede a sub-query by the ___ operator, the condition is true only if it satisfied all values produced by the sub-query.
question
any
answer
If you precede a sub-query by the ___ operator, the condition is true only is it satisfied one or more values produced by the sub-query.
question
inner
answer
A join that compares the tables in the from clause and lists only those rows that satisfy the condition in the where clause is called an ___ join.
question
full outer
answer
Sometimes you need to list all the rows from one of the tables in a join, regardless of whether they match any rows in the other table. This type of join is called a ____ join.
question
product
answer
The ___ of two tables is the combination of all rows in the first table and all rows in the second table.