Deck 5: Multiple Table Queries

ملء الشاشة (f)
exit full mode
سؤال
You can use the EXISTS operator to retrieve data from more than one table.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
When a subquery involves a table listed in the outer query, the subquery is called a(n) _____.

A) inner outer subquery
B) correlated subquery
C) reverse subquery
D) parameter subquery
سؤال
In which type of join will all rows from the table listed second in the query be included regardless of whether they match rows from the table listed first in the query?

A) left inner join
B) left outer join
C) right outer join
D) right inner join
سؤال
To retrieve data from multiple tables in a query, you can use a subquery containing the _____.

A) AND operator
B) IN operator
C) OR operator
D) NOT operator
سؤال
You create an alias by typing the name of the table, pressing the _____, and then typing the name of the alias.

A) Tab key
B) Backspace key
C) Enter key
D) Spacebar
سؤال
A condition is true if it satisfies any value (one or more) produced by a subquery that is preceded by the _____.

A) IS SOME operator
B) ALL operator
C) SOME operator
D) ANY operator
سؤال
You can join tables by using a condition in the _____.

A) FROM clause
B) WHERE clause
C) SELECT clause
D) JOIN clause
سؤال
The _____ of two tables is a table containing every row that is in either the first table, the second table, or both tables.

A) intersection
B) union
C) minus
D) difference
سؤال
When is it necessary to qualify a column name while joining tables in MySQL?

A) It is necessary when the tables have identical column names.
B) It is necessary when the tables have different column names.
C) It is never necessary when you join tables in MySQL.
D) It is necessary every time you join tables in MySQL.
سؤال
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.
سؤال
The ____ of two tables is the set of all rows that are in the first table but that are not in the second table.

A) union
B) inner join
C) intersection
D) difference
سؤال
You can use the IN operator to retrieve data from multiple tables.
سؤال
The _____ of two tables is a table containing all rows that are in both tables.

A) intersection
B) union
C) difference
D) minus
سؤال
To create a condition that is true if one or more rows are obtained when the subquery is executed, you can precede that subquery with which operator?

A) IS NULL
B) IS TRUE
C) IS EXIST
D) EXISTS
سؤال
The product of two tables is formally called the _____.

A) inner join
B) outer join
C) SQL product
D) Cartesian product
سؤال
Nina is writing a MySQL query to list the descriptions of items in the CUPCAKES table, which are identified by PROD_ID values. The ORDER_LINE table includes product and quantity information from bakery orders, which are identified by ORDER_NUM values. What can she add to the following query to limit the list to descriptions of cupcakes purchased through order 342? SELECT DESCRIPTION FROM CUPCAKES WHERE

A) PROD_ID IN(ORDER_LINE WHERE(ORDER_NUM = '342'));
B) EXISTS (PROD_ID WHERE (ORDER_LINE.ORDER_NUM = '342'));
C) PROD_ID IN(SELECT PROD_ID FROM ORDER_LINE WHERE(ORDER_NUM = '342'));
D) PROD_ID EXISTS(SELECT PROD_ID FROM ORDER_LINE WHERE(ORDER_NUM = '342'));
سؤال
In a nested query, the outer query is evaluated first.
سؤال
In which type of join are all rows from the table listed first in the query included, regardless of whether they match rows from the table listed second in the query?

A) left inner join
B) left outer join
C) right inner join
D) right outer join
سؤال
You can use the ALL and ANY operators with subqueries to produce a single column of numbers.
سؤال
To qualify a column name, precede the name of the column with the name of the table, followed by a(n) _____.

A) comma (,)
B) period (.)
C) percent sign (%)
D) asterisk (*)
سؤال
Suppose you have an ADDRESS_BOOK table containing the first and last names, addresses, and birthdays of many people you know. How can you write a query to display the names of pairs of your acquaintances who have the same birthday?

A) create a new set using ADDRESS_BOOK
B) perform an outer join on ADDRESS_BOOK
C) self-join ADDRESS_BOOK to itself
D) create a second BIRTHDAY table
سؤال
There are three set operations: union, intersection, and difference. Define each of these operations. Which are supported by Oracle?
سؤال
Describe the types of outer joins.
سؤال
One use case for an alias is a query that joins a table to itself, known as a(n) _____.

A) inner join
B) outer join
C) union
D) self-join
سؤال
When tables are listed in the FROM clause of an SQL query, you can give them alternate names, also known as _____.

A) sets
B) qualifiers
C) groups
D) aliases
سؤال
When a query includes the clause FROM CLIENT A, CLIENT B, SQL will _____.

A) perform an inner join
B) perform an outer join
C) treat it as a query of two tables, A and B
D) treat it as a union of two tables, A and B
سؤال
Which element belongs in the blank if you want to display data from all rows with a credit limit greater than the credit limit of one or more category B cardholders? WHERE (CREDIT_LIMIT > _____ (SELECT CREDIT_LIMIT FROM CARDHOLDER WHERE CATEGORY = 'B'))

A) ANY
B) ALL
C) UNION
D) INTERSECT
سؤال
Which statement about table joins in SQL is true?

A) Self-joins usually do not include WHERE or ORDER BY clauses.
B) You cannot perform a self-join on a table's primary key column.
C) Joins must be performed between at least two different tables.
D) SQL has no problem treating one table with two aliases as two tables.
سؤال
What steps should you take to construct the SQL command to join (relate) tables?
سؤال
What steps should you take to construct a detailed query in a step-by-step fashion?
سؤال
What is the term for the letter S or the letter D in the following query? ​
SELECT S.SERVER_ID, S.LAST_NAME, D.DINER_ID, D.LAST_NAME
FROM SERVER S, DINER D
WHERE (S.SERVER_ID = D.SERVER_ID)

A) alias
B) operator
C) qualifier
D) set
سؤال
Which statement about nested queries in SQL is FALSE?

A) In small databases, there is not a significant time difference between nested subqueries and table joins.
B) Typically, nested subqueries perform faster than queries that join tables.
C) A nested query is a subquery within a subquery.
D) Executing each subquery in a nested query produces a temporary table.
سؤال
What is the benefit of using an alias in MySQL?

A) It improves performance.
B) It simplifies complex queries.
C) It prevents confusion of columns from different tables.
D) It is required for calculations.
سؤال
Why do you use the ANY and ALL operators? What is the difference between the two operators?
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/34
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 5: Multiple Table Queries
1
You can use the EXISTS operator to retrieve data from more than one table.
True
2
When a subquery involves a table listed in the outer query, the subquery is called a(n) _____.

A) inner outer subquery
B) correlated subquery
C) reverse subquery
D) parameter subquery
B
3
In which type of join will all rows from the table listed second in the query be included regardless of whether they match rows from the table listed first in the query?

A) left inner join
B) left outer join
C) right outer join
D) right inner join
C
4
To retrieve data from multiple tables in a query, you can use a subquery containing the _____.

A) AND operator
B) IN operator
C) OR operator
D) NOT operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
5
You create an alias by typing the name of the table, pressing the _____, and then typing the name of the alias.

A) Tab key
B) Backspace key
C) Enter key
D) Spacebar
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
6
A condition is true if it satisfies any value (one or more) produced by a subquery that is preceded by the _____.

A) IS SOME operator
B) ALL operator
C) SOME operator
D) ANY operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
7
You can join tables by using a condition in the _____.

A) FROM clause
B) WHERE clause
C) SELECT clause
D) JOIN clause
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
8
The _____ of two tables is a table containing every row that is in either the first table, the second table, or both tables.

A) intersection
B) union
C) minus
D) difference
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
9
When is it necessary to qualify a column name while joining tables in MySQL?

A) It is necessary when the tables have identical column names.
B) It is necessary when the tables have different column names.
C) It is never necessary when you join tables in MySQL.
D) It is necessary every time you join tables in MySQL.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
10
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
11
The ____ of two tables is the set of all rows that are in the first table but that are not in the second table.

A) union
B) inner join
C) intersection
D) difference
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
12
You can use the IN operator to retrieve data from multiple tables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
13
The _____ of two tables is a table containing all rows that are in both tables.

A) intersection
B) union
C) difference
D) minus
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
14
To create a condition that is true if one or more rows are obtained when the subquery is executed, you can precede that subquery with which operator?

A) IS NULL
B) IS TRUE
C) IS EXIST
D) EXISTS
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
15
The product of two tables is formally called the _____.

A) inner join
B) outer join
C) SQL product
D) Cartesian product
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
16
Nina is writing a MySQL query to list the descriptions of items in the CUPCAKES table, which are identified by PROD_ID values. The ORDER_LINE table includes product and quantity information from bakery orders, which are identified by ORDER_NUM values. What can she add to the following query to limit the list to descriptions of cupcakes purchased through order 342? SELECT DESCRIPTION FROM CUPCAKES WHERE

A) PROD_ID IN(ORDER_LINE WHERE(ORDER_NUM = '342'));
B) EXISTS (PROD_ID WHERE (ORDER_LINE.ORDER_NUM = '342'));
C) PROD_ID IN(SELECT PROD_ID FROM ORDER_LINE WHERE(ORDER_NUM = '342'));
D) PROD_ID EXISTS(SELECT PROD_ID FROM ORDER_LINE WHERE(ORDER_NUM = '342'));
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
17
In a nested query, the outer query is evaluated first.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
18
In which type of join are all rows from the table listed first in the query included, regardless of whether they match rows from the table listed second in the query?

A) left inner join
B) left outer join
C) right inner join
D) right outer join
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
19
You can use the ALL and ANY operators with subqueries to produce a single column of numbers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
20
To qualify a column name, precede the name of the column with the name of the table, followed by a(n) _____.

A) comma (,)
B) period (.)
C) percent sign (%)
D) asterisk (*)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
21
Suppose you have an ADDRESS_BOOK table containing the first and last names, addresses, and birthdays of many people you know. How can you write a query to display the names of pairs of your acquaintances who have the same birthday?

A) create a new set using ADDRESS_BOOK
B) perform an outer join on ADDRESS_BOOK
C) self-join ADDRESS_BOOK to itself
D) create a second BIRTHDAY table
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
22
There are three set operations: union, intersection, and difference. Define each of these operations. Which are supported by Oracle?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
23
Describe the types of outer joins.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
24
One use case for an alias is a query that joins a table to itself, known as a(n) _____.

A) inner join
B) outer join
C) union
D) self-join
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
25
When tables are listed in the FROM clause of an SQL query, you can give them alternate names, also known as _____.

A) sets
B) qualifiers
C) groups
D) aliases
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
26
When a query includes the clause FROM CLIENT A, CLIENT B, SQL will _____.

A) perform an inner join
B) perform an outer join
C) treat it as a query of two tables, A and B
D) treat it as a union of two tables, A and B
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which element belongs in the blank if you want to display data from all rows with a credit limit greater than the credit limit of one or more category B cardholders? WHERE (CREDIT_LIMIT > _____ (SELECT CREDIT_LIMIT FROM CARDHOLDER WHERE CATEGORY = 'B'))

A) ANY
B) ALL
C) UNION
D) INTERSECT
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
28
Which statement about table joins in SQL is true?

A) Self-joins usually do not include WHERE or ORDER BY clauses.
B) You cannot perform a self-join on a table's primary key column.
C) Joins must be performed between at least two different tables.
D) SQL has no problem treating one table with two aliases as two tables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
29
What steps should you take to construct the SQL command to join (relate) tables?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
30
What steps should you take to construct a detailed query in a step-by-step fashion?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
31
What is the term for the letter S or the letter D in the following query? ​
SELECT S.SERVER_ID, S.LAST_NAME, D.DINER_ID, D.LAST_NAME
FROM SERVER S, DINER D
WHERE (S.SERVER_ID = D.SERVER_ID)

A) alias
B) operator
C) qualifier
D) set
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
32
Which statement about nested queries in SQL is FALSE?

A) In small databases, there is not a significant time difference between nested subqueries and table joins.
B) Typically, nested subqueries perform faster than queries that join tables.
C) A nested query is a subquery within a subquery.
D) Executing each subquery in a nested query produces a temporary table.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
33
What is the benefit of using an alias in MySQL?

A) It improves performance.
B) It simplifies complex queries.
C) It prevents confusion of columns from different tables.
D) It is required for calculations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
34
Why do you use the ANY and ALL operators? What is the difference between the two operators?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 34 في هذه المجموعة.