Section 7 Quiz
Section 7 Quiz
1.You need to join the EMPLOYEES table and the SCHEDULES table, Mark for Review
but the two tables do not have any corresponding columns. Which type (1) Points
of join will you create?
Correct
2.Which statement about joining tables with a non-equijoin is false? Mark for Review
(1) Points
Correct
3.Nonequijoins are normally used with which of the following? (Choose Mark for Review
two) (1) Points
Ranges of text
Ranges of rowids
Ranges of dates (*)
ranges of columns
Ranges of numbers (*)
Correct
4.The EMPLOYEE_ID column in the EMPLOYEES table corresponds Mark for Review
to the EMPLOYEE_ID column of the ORDERS table. (1) Points
The EMPLOYEE_ID column in the ORDERS table contains null
values for rows that you need to display.
Which type of join should you use to display the data?
Self-join
Natural join
Equijoin
Outer join (*)
Correct
Correct
6.Evaluate this Mark for Review
SELECT (1) Points
statement:
SELECT
p.player_id,
m.last_name,
m.first_name,
t.team_name
FROM player
p
LEFT
OUTER JOIN
player m ON
(p.manager_id
=
m.player_id)
LEFT
OUTER JOIN
team t ON
(p.team_id =
t.team_id);
Which join is
evaluated
first?
The join between the player table and the team table on
MANAGER_ID
The join between the player table and the team table on
PLAYER_ID
The self-join of the player table (*)
The join between the player table and the team table on
TEAM_ID
Correct
7. The ID column in the CLIENT table that corresponds to Mark for Review
the CLIENT_ID column of the ORDER table contains null (1) Points
values for rows that need to be displayed. Which type of
join should you use to display the data?
Correct
8. What is the result of a query that selects from two tables Mark for Review
but includes no join condition? (1) Points
A syntax error
A selection of matched rows from both tables
A Cartesian product (*)
A selection of rows from the first table only
Correct
9. When must column names be prefixed by table names in Mark for Review
join syntax? (1) Points
Correct
10. You have the following EMPLOYEES table: Mark for Review
(1) Points
EMPLOYEE_ID NUMBER(5) NOT NULL PRIMARY
KEY
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
ADDRESS VARCHAR2(35)
CITY VARCHAR2(25)
STATE VARCHAR2(2)
ZIP NUMBER(9)
TELEPHONE NUMBER(10)
DEPARTMENT_ID NUMBER(5) NOT NULL
FOREIGN KEY
(*)
SELECT first_name, last_name, annual_salary *
bonus_pct
FROM employees, bonus NATURAL JOIN;
Correct
11.Evaluate this SQL Mark for Review
statement: (1) Points
SELECT e.employee_id,
e.last_name,
e.first_name,
d.department_name
FROM employees e,
departments d
WHERE e.department_id
= d.department_id AND
employees.department_id
> 5000
ORDER BY 4;
Correct
12. You have two tables named EMPLOYEES Mark for Review
and SALES. You want to identify the sales (1) Points
representatives who have generated at least
$100,000 in revenue.
Which query should you issue?
(*)
SELECT first_name, last_name, sales
FROM employees e, sales s
WHERE e.employee_id = s.employee_id
AND revenue > 100000;
SELECT e.first_name, e.last_name, s.sales
FROM employees, sales
WHERE e.employee_id = s.employee_id
AND revenue >= 100000;
SELECT e.first_name, e.last_name, s.sales
FROM employees e, sales s
WHERE e.employee_id = s.employee_id
AND revenue > 100000;
Correct
13. You have been asked to create a report that Mark for Review
lists all corporate customers and all orders that (1) Points
they have placed. The customers should be
listed alphabetically beginning with the letter
'A', and their corresponding order totals should
be sorted from the highest amount to the
lowest amount.
Which of the following statements should you
issue?
(*)
SELECT c.custid, c.companyname,
o.orderdate, o. custid, o.amount
FROM customers c, orders o
WHERE c.custid = o.custid
ORDER BY amount DESC,
companyname;
SELECT c.custid, c.companyname,
o.orderdate, o. custid, o.amount
FROM customers c, orders o
WHERE c.custid = o.custid
ORDER BY companyname ASC, amount
ASC;
SELECT c.custid, c.companyname,
o.orderdate, o. custid, o.amount
FROM customers c, orders o
WHERE c.custid = o.custid
ORDER BY companyname, amount;
Correct
14. If table A has 10 rows and table B has 5 rows, Mark for Review
how many rows will be returned if you (1) Points
perform a equi-join on those two tables?
50
It depends on how many rows have
matching data in each of the two tables.
(*)
5
10
Correct
15. Oracle proprietary JOINS can use the Mark for Review
WHERE clause for conditions other than the (1) Points
join-condition. True or False?
True (*)
False
Correct