Anda di halaman 1dari 19

1One-to-One

. relationships
are
transformed
into Check
Constraints
in the tables
created at
either end of
that
relationship.
True or
False?

Mark for Review


(1) Points

True
False (*)
Incorrect. Refer to Section 11
Lesson 3.
2. The Oracle Database can implement a many-to-many
relationship. You simply create two foreign keys between
the two tables. True or False?

Mark for Review


(1) Points

True
False (*)
Correct
3. When translating an arc relationship to a physical design,
you must turn the arc relationships into foreign keys.
Assuming you are implementing an Exclusive Design, you
must also create two Unique Key Constraints to ensure the
Arc is implemented correctly. True or False?

Mark for Review


(1) Points

True
False (*)
Correct
4. Foreign keys must be null. True or False?

Mark for Review


(1) Points

True

False (*)
Incorrect. Refer to Section 11
Lesson 1.
5. Identify all of the incorrect statements that complete this
sentence: A primary key is: (Choose three)

Mark for Review


(1) Points

(Choose all correct answers)


A single column that uniquely identifies each column in
a table. (*)
One or more columns in a table that uniquely identifies
each row in that table.
A set of columns in one table that uniquely identifies
each row in another table. (*)
Only one column that must be null. (*)
Incorrect. Refer to Section 11
Lesson 1.
6. The explanation below is a User Defined integrity rule and
must, therefore, be manually coded; the Database cannot
enforce this rule automatically. True or False?

Mark for Review


(1) Points

A primary key must be unique, and no part of the primary


key can be null.
True
False (*)
Correct
7. The text below is an example of what constraint type?
If the number of BOOKS lent to a BORROWER in the
LIBRARY exceeds 5, then we must send him a letter
requesting the return of the BOOKS; this will require extra
programming to enforce.
Entity integrity
User-defined integrity (*)

Mark for Review


(1) Points

Column integrity
Referential integrity
Incorrect. Refer to Section 11
Lesson 1.
8. A foreign key cannot refer to a primary key in the same
table. True or False?

Mark for Review


(1) Points

True
False (*)
Correct
9. Why would this table name NOT work in an Oracle
database? this_year_end+next_year

Mark for Review


(1) Points

Table names must begin with an alphabetic character.


It is too long.
The Plus sign + is not allowed in object names. (*)
None of the above.
Incorrect. Refer to Section 11
Lesson 2.
10. In a physical data model, an attribute becomes a
_____________.

Mark for Review


(1) Points

Table
Foreign Key
Constraint
Column (*)
Incorrect. Refer to Section 11
Lesson 2.
11.The
transformation
from an ER
diagram to a
physical design

Mark for Review


(1) Points

involves
changing
terminology.
Primary
Unique
Identifiers in
the ER diagram
become
__________
and
relationships
become
____________.
Foreign keys, Primary keys
Primary keys, Foreign keys (*)
Foreign keys, mandatory business rules
Unique Keys, Primary keys
Correct

Section 12
(Answer all questions in this section)
12. The _______ clause can be added to a SELECT
statement to return a subset of the data.

Mark for Review


(1) Points

ANYWHERE
WHICH
WHERE (*)
EVERY
Incorrect. Refer to Section 12
Lesson 1.
13. What command will return data from the database to
you?

Mark for Review


(1) Points

FETCH
GET

SELECT (*)
RETURN
Correct.
14. What command can be used to create a new row in a
table in the database?

Mark for Review


(1) Points

CREATE
NEW
ADD
INSERT (*)
Incorrect. Refer to Section 12
Lesson 1.
15. System Documentation is developed right at the end
once the system has gone live and users have been using
it for a little while. You are more likely to get it correct
that way. True or False?

Mark for Review


(1) Points

True
False (*)
Correct.
16. Systems are always just rolled out as soon as the
programming phase is finished. No further work is
required once the development is finished. True or
False?

Mark for Review


(1) Points

True
False (*)
Incorrect. Refer to Section 12
Lesson 4.
17. Once you have created a table, it is not possible to alter
the definition of it. If you need to add a new column
you must delete the table definition and create a new,
correct table. True or False?
True

Mark for Review


(1) Points

False (*)
Correct.
18. The SQL statement ALTER TABLE EMPLOYEES
DELETE COLUMN SALARY is a valid statement.
True or False?

Mark for Review


(1) Points

True
False (*)
Correct.

Section 15
(Answer all questions in this section)
19. Which statement best describes how arithmetic
expressions are handled?

Mark for Review


(1) Points

Addition operations are handled before any other


operations.
Multiplication and subtraction operations are
handled before any other operations.
Multiplication and addition operations are handled
before subtraction and division operations.
Division and multiplication operations are handled
before subtraction and addition operations. (*)
Incorrect. See Section 15
Lesson 1.
20. Which SQL keyword specifies that an alias will be
substituted for a column name in the output of a SQL
query?
AS (*)
OR
AND
SUBSTITUTE
Correct.

Mark for Review


(1) Points

21When
. listing
columns
in the
SELECT
list, what
should
you use
to
separate
the
columns?

Mark for Review


(1) Points

Commas (*)
Semicolons
Dashes
Underscores
Correct.
22. In the default order of precedence, which operator would be
evaluated first?

Mark for Review


(1) Points

Subtractions and Additions are at the same level and


would be evaluated first based on left to right order
Multiplications and Divisions are at the same level and
would be evaluated first based on left to right order (*)
Additions and Multiplications are at the same level and
would be evaluated first based on left to right order
Divisions and Subtractions are at the same level and
would be evaluated first based on left to right order
Incorrect. See Section 15 Lesson 1.
23. What would you use in the SELECT clause to return all the
columns in the table?

Mark for Review


(1) Points

An asterisk (*) (*)


A minus sign (-)
A plus sign (+)
The ALL keyword

Correct.
24. You query the database with this SQL statement:
SELECT *
FROM transaction
WHERE product_id = 4569;

Mark for Review


(1) Points

Which SQL SELECT statement capabilities are achieved


when this statement is executed?
Selection only
Projection only
Selection and projection only (*)
Projection, selection and joining
Incorrect. See Section 15 Lesson 1.

Section 16
(Answer all questions in this section)
25. If you write queries using the BETWEEN operator, it does not
matter in what order you enter the values, i.e. BETWEEN low
value AND high value will give the same result as
BETWEEN high value and low value. True or False?

Mark for Review


(1) Points

True
False (*)
Incorrect. See Section 16 Lesson 3.
26. The EMPLOYEES table includes these columns:
EMPLOYEE_ID NUMBER(4) NOT NULL
LAST_NAME VARCHAR2(15) NOT NULL
FIRST_NAME VARCHAR2(10) NOT NULL
HIRE_DATE DATE NOT NULL
You want to produce a report that provides the last names,
first names, and hire dates of those employees who were hired
between March 1, 2000, and August 30, 2000. Which

Mark for Review


(1) Points

statements can you issue to accomplish this task?


SELECT last_name, first_name, hire_date
FROM employees
WHERE hire_date BETWEEN '01-MAR-2000' AND '30AUG-2000';
(*)
SELECT last_name, first_name, hire_date
FROM employees
WHERE hire_date BETWEEN '30-AUG-2000' AND '01MAR-2000';
SELECT last_name, first_name, hire_date
FROM employees
GROUP BY hire_date >= '01-MAR-2000' and hire_date
<= '30- AUG-2000';
SELECT last_name, first_name, hire_date
FROM employees
AND hire_date >= '01-MAR-2000' and hire_date <= '30AUG-2000';
Correct.
27. Which clause would you include in a SELECT statement to
restrict the data returned to only the employees in department
10?

Mark for Review


(1) Points

WHERE (*)
FROM
SELECT
IS
Incorrect. See Section 16 Lesson 1.
28. You need to display employees whose salary is in the range of
30000 and 50000. Which comparison operator should you
use?
IN
LIKE
BETWEEN...AND... (*)
IS NULL

Mark for Review


(1) Points

Correct.
29. You need to display only unique combinations of the
LAST_NAME and MANAGER_ID columns in the
EMPLOYEES table. Which keyword should you include in
the SELECT clause?

Mark for Review


(1) Points

ONLY
UNIQUEONE
DISTINCT (*)
DISTINCTROW
Correct.
30. What does the DISTINCT keyword do when it is used in a
SELECT clause?

Mark for Review


(1) Points

Hides NULL values


Eliminates all unique values and compares values
Eliminates duplicate rows in the result (*)
Eliminates only unique rows in the result
Incorrect. See Section 16 Lesson 1.
31Which
. statement
best
describes
how
column
headings
are
displayed
by default
in Oracle
Application
Express:

Mark for Review


(1) Points

Column headings are displayed left-justified and in


lowercase.
Column headings are displayed left-justified and in
uppercase.
Column headings are displayed centered and in

uppercase. (*)
Column headings are displayed centered and in mixed
case.
Incorrect. See Section 16 Lesson
1.
32. Which comparison operator searches for a specified
character pattern?

Mark for Review


(1) Points

IN
LIKE (*)
BETWEEN...AND...
IS NULL
Incorrect. See Section 16 Lesson
1.
33. Which of the following commands will display the last
name concatenated with the job ID from the employees
table, separated by a comma and space, and label the
resulting column "Employee and Title"?

Mark for Review


(1) Points

SELECT " last name" ||', '|| "job_id" + "Employee and


Title" FROM employees;
SELECT last_name||', '|| job_id "Employee and Title"
FROM employees; (*)
SELECT " last name" ||', '|| "job_id" + "Employee and
Title" FROM emp;
SELECT last_name||","|| job_id "Employee and Title"
FROM employees;
Incorrect. See Section 16 Lesson
2.
34. Evaluate this SELECT statement:
SELECT last_name, first_name, salary
FROM employees;
How will the heading for the FIRST_NAME column appear
in the display by default in Oracle Application Express?
The heading will display with the first character
capitalized and centered.

Mark for Review


(1) Points

The heading will display with the first character


capitalized and left justified.
The heading will display as uppercase and centered. (*)
The heading will display as uppercase and left justified.
Incorrect. See Section 16 Lesson
2.
35. If the EMPLOYEES table has the following columns, and
you want to write a SELECT statement to return the
employee last name and department number for employee
number 176, which of the following SQL statements should
you use?
Name

Type

Length

EMPLOYEE_ID

NUMBER

22

FIRST_NAME

VARCHAR2

20

LAST_NAME

VARCHAR2

25

EMAIL

VARCHAR2

25

PHONE_NUMBER

VARCHAR2

20

SALARY

NUMBER

22

COMMISSION_PCT

NUMBER

22

MANAGER_ID

NUMBER

22

DEPARTMENT_ID

NUMBER

22

Mark for Review


(1) Points

SELECT last_name, department_id


FROM employees
WHERE employee_id = 176;
(*)
SELECT last_name, department_id
FROM employees
WHERE employee_id equals 176;
SELECT first_name, employee_id
FROM employees
WHERE employee_id = 176;
SELECT last_name, employee_id
FROM employees
WHERE employee_id equals 176;
Correct.
36. You need write a SELECT statement that should only return
rows that contain 34, 46, or 48 for the DEPARTMENT_ID

Mark for Review

column. Which operator should you use in the WHERE


clause to compare the DEPARTMENT_ID column to this
specific list of values?

(1) Points

=
!=
IN (*)
BETWEEN..AND..
Incorrect. See Section 16 Lesson
2.

Section 17
(Answer all questions in this section)
37. Which statement about the logical operators is true?

Mark for Review


(1) Points

The order of operator precedence is AND, OR, and


NOT.
The order of operator precedence is AND, NOT, and
OR.
The order of operator precedence is NOT, OR, and
AND.
The order of operator precedence is NOT, AND, and
OR. (*)
Incorrect. See Section 17 Lesson
1.
38. Which of the following are TRUE regarding the logical
AND operator?

Mark for Review


(1) Points

TRUE AND TRUE return FALSE


TRUE AND FALSE return TRUE
FALSE AND TRUE return NULL
TRUE AND FALSE return FALSE (*)
Incorrect. See Section 17 Lesson
1.

39. Which statement about the default sort order is true?

Mark for Review


(1) Points

The lowest numeric values are displayed last.


The earliest date values are displayed first. (*)
Null values are displayed first.
Character values are displayed in reverse alphabetical
order.
Incorrect. See Section 17 Lesson
1.
40. The ORDER BY clause always comes last. True or False?

Mark for Review


(1) Points

True (*)
False
Correct.
41You need to
. change the
default sort
order of the
ORDER
BY clause
so that the
data is
displayed
in reverse
alphabetical
order.
Which
keyword
should you
include in
the
ORDER
BY clause?

Mark for Review


(1) Points

DESC (*)
ASC
SORT

CHANGE
Incorrect. See Section 17 Lesson
1.
42. Which statement about the ORDER BY clause is true?

Mark for Review


(1) Points

You can use a column alias in the ORDER BY clause.


(*)
The default sort order of the ORDER BY clause is
descending.
The ORDER BY clause can only contain columns that
are included in the SELECT list.
The ORDER BY clause should immediately precede
the FROM clause in a SELECT statement
Incorrect. See Section 17 Lesson
1.
43. You attempt to query the database with this SQL statement:
SELECT product_id "Product Number", category_id
"Category", price "Price"
FROM products
WHERE "Category" = 5570
ORDER BY "Product Number";

Mark for Review


(1) Points

This statement fails when executed. Which clause contains


a syntax error?
SELECT product_id "Product Number", category_id
"Category", price "price"
ORDER BY "Product Number";
FROM products
WHERE "Category" = 5570 (*)
Correct.
44. Evaluate this SELECT statement:
SELECT *
FROM employees
WHERE department_id = 34

Mark for Review


(1) Points

OR department_id = 45
OR department_id = 67;
Which operator is the equivalent of the OR conditions used
in this SELECT statement?
IN (*)
AND
LIKE
BETWEEN ... AND ...
Incorrect! See Section 17 Lesson
2.
45. Evaluate this SELECT statement:
SELECT last_name, first_name, department_id,
manager_id
FROM employees;

Mark for Review


(1) Points

You need to sort data by manager id values and then


alphabetically by employee last name and first name values.
Which ORDER BY clause could you use?
ORDER BY department_id, last_name
ORDER BY manager_id, last_name, first_name (*)
ORDER BY last_name, first_name, manager_id
ORDER BY manager_id, first_name, last_name
Correct.
46. Evaluate this SELECT statement:
SELECT first_name, last_name, email
FROM employees
ORDER BY last_name;
Which statement is true?
The rows will not be sorted.

Mark for Review


(1) Points

The rows will be sorted alphabetically by the


LAST_NAME values. (*)
The rows will be sorted in reverse alphabetical order by
the LAST_NAME values.
The rows will be sorted alphabetically by the
FIRST_NAME and then the LAST_NAME values
Correct.
47. Evaluate this SELECT statement:
SELECT last_name, first_name, email
FROM employees
ORDER BY email;

Mark for Review


(1) Points

If the EMAIL column contains null values, which statement


is true?
Null email values will be displayed first in the result.
Null email values will be displayed last in the result.
(*)
Null email values will not be displayed in the result.
The result will not be sorted.
Incorrect! See Section 17 Lesson
2.
48. The PLAYERS table contains these columns:
PLAYERS TABLE:
LAST_NAME VARCHAR2 (20)
FIRST_NAME VARCHAR2 (20)
SALARY NUMBER(8,2)
TEAM_ID NUMBER(4)
MANAGER_ID NUMBER(9)
POSITION_ID NUMBER(4)
You must display the player name, team id, and salary for
players whose salary is in the range from 25000 through
100000 and whose team id is in the range of 1200 through
1500. The results must be sorted by team id from lowest to
highest and then further sorted by salary from highest to
lowest. Which statement should you use to display the
desired result?

Mark for Review


(1) Points

SELECT last_name, first_name, team_id, salary


FROM players
WHERE (salary > 25000 OR salary < 100000)
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id, salary;
SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary BETWEEN 25000 AND 100000
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id, salary DESC;
(*)
SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary > 24999.99 AND salary < 100000
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id ASC, salary DESC;
SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary BETWEEN 24999.99 AND 100000.01
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id DESC, salary DESC;
Incorrect! See Section 17 Lesson
3.
49. Evaluate this SQL statement:
SELECT e.employee_id, e.last_name, e.first_name,
m.manager_id
FROM employees e, employees m
ORDER BY e.last_name, e.first_name
WHERE e.employee_id = m.manager_id;
This statement fails when executed. Which change will
correct the problem?
Reorder the clauses in the query. (*)
Remove the table aliases in the WHERE clause.
Remove the table aliases in the ORDER BY clause.
Include a HAVING clause.
Incorrect! See Section 17 Lesson

Mark for Review


(1) Points

50. The PLAYERS table contains these columns:


PLAYERS TABLE:
LAST_NAME VARCHAR2 (20)
FIRST_NAME VARCHAR2 (20)
SALARY NUMBER(8,2)
TEAM_ID NUMBER(4)
MANAGER_ID NUMBER(9)
POSITION_ID NUMBER(4)
You want to display all players' names with position 6900
or greater.
You want the players names to be displayed alphabetically
by last name and then by first name.
Which statement should you use to achieve the required
results?
SELECT last_name, first_name
FROM players
WHERE position_id >= 6900
ORDER BY last_name, first_name;
(*)
SELECT last_name, first_name
FROM players
WHERE position_id > 6900
ORDER BY last_name, first_name;
SELECT last_name, first_name
FROM players
WHERE position_id <= 6900
ORDER BY last_name, first_name;
SELECT last_name, first_name
FROM players
WHERE position_id >= 6900
ORDER BY last_name DESC, first_name;
Incorrect! See Section 17 Lesson
3.

Mark for Review


(1) Points

Anda mungkin juga menyukai