Sei sulla pagina 1di 16

1.

Which of the Mark for Review


following is a
valid reason
for considering (1) Points
a Subtype
Implementatio
n?

The resulting table will reside in a single database and


be used by just ONE user.
The common access paths for the supertypes are
different.
Business functionality, business rules, access paths, and
frequency of access are all very different between the
subtypes. (*)
Most of the relationships are at the supertype level.

Correct

2. The transformation from an ER diagram to a physical design Mark for


involves changing terminology. Secondary Unique Identifiers
become
Review
(1) Points

Columns
Tables
Unique Constraints (*)
Primary Key Constraints

Correct

3. Attributes become tables in a database. True or False? Mark for

Review
(1) Points

True
False (*)

Correct

4. In an Oracle database, why would 1_TABLE not work as a Mark for


table name?

Review
(1) Points

The database does not understand all capital letters.


There is no problem here. You can create a table called
1_TABLE.
Object names must not start with a number. They must
begin with a letter. (*)
TABLE is a reserved word.
Correct

5. The text below is an example of what constraint type? Mark for

If the number of BOOKS lent to a BORROWER in the LIBRARY


exceeds 5, then we must send him a letter requesting the Review
return of the BOOKS; this will require extra programming to (1) Points
enforce.

Entity integrity
User-defined integrity (*)
Column integrity
Referential integrity

Incorrect. Refer to Section 11 Lesson


1.

6. Foreign keys must be null. True or False? Mark for

Review
(1) Points

True
False (*)

Correct

7. A foreign key cannot refer to a primary key in the same Mark for
table. True or False?

Review
(1) Points

True
False (*)

Correct

8. Entity integrity refers to: Mark for

Review
(1) Points

Tables always containing text data


Tables always containing numeric data
Columns having Primary Keys, Foreign Keys, Unique
Keys, and Check constraints defined in the database.
Tables having Primary Keys, Foreign Keys, Unique Keys,
and Check constraints defined in the database. (*)

Incorrect. Refer to Section 11 Lesson


1.
9. A table must have at least one candidate key, as well as its Mark for
primary key. True or False?

Review
(1) Points

True
False (*)

Correct

10. It is possible to implement non-transferability via a simple Mark for


Foreign Key Relationship. True or False?

Review
(1) Points

True
False (*)

Correct
11. To resolve a many to Mark for Review
many relationship in
a physical model you
create a/an (1) Points
___________________?

Unique key constraints


Intersection entity
Intersection table (*)
Two tables with Foreign key constraints between
them

Correct

Section 12
(Answer all questions in this section)

12. Once you have created a table, it is not possible to Mark for
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? Review
(1) Points

True
False (*)

Correct.

13. The f_customers table contains the following data: Mark for
ID Name Address City State Zip
1 Cole Bee 123 Main Street Orlando FL 32838 Review
(1) Points
2 Zoe Twee 1009 Oliver Avenue Boston MA 02116
3 Sandra Lee 22 Main Street Tampa FL 32444

If you run the following statement:


DELETE FROM F_CUSTOMERS WHERE ID <= 2;

How many rows will be left in the table?

0
3
1 (*)
2

Correct.

14. In the Analysis phase, the tables are created and Mark for
populated with test data. True or False?

Review
(1) Points

True
False (*)

Correct.

15. During which phases of the System Development Life Mark for
Cycle would you test the system before rolling it out
to the users?
Review
(1) Points

Build and Transition


Strategy and Analysis
Design and Production
Transition and Production (*)

Correct.

16. What command can be used to create a new row in a Mark for
table in the database?

Review
(1) Points

CREATE
NEW
ADD
INSERT (*)
Correct.

17. What command will return data from the database to Mark for
you?

Review
(1) Points

FETCH
GET
SELECT (*)
RETURN

Correct.

18. The DESCRIBE command returns all rows from a Mark for
table. True or False?

Review
(1) Points

True
False (*)

Correct.

Section 15
(Answer all questions in this section)

19. In a SELECT clause, what is the result of 2 + 3 * 2? Mark for

Review
(1) Points

6
8 (*)
10
13

Correct.

20. In which clause of a SELECT statement would you Mark for


specify the name of the table or tables being
queried?
Review
(1) Points

The FROM clause (*)


The SELECT clause
The WHERE clause
Any of the above options; you can list tables
wherever you want in a SELECT statement.

Correct.
21. Evaluate this Mark for Review
SELECT
statement:
(1) Points
SELECT
(salary *
raise_percent)
raise
FROM
employees;

If the
RAISE_PERCEN
T column only
contains null
values, what
will the
statement
return?

Only zeroes
Only null values (*)
A null value or a zero depending on the value of the
SALARY column
A null value or a numeric value depending on the value
of the SALARY column

Correct.

22. You query the database with this SQL statement: Mark for

SELECT *
FROM transaction Review
WHERE product_id = 4569; (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.

23. When you use the SELECT clause to list one or two columns Mark for
only from a table and no WHERE clause, which SQL
capability is used?
Review
(1) Points
Joining only
Selection only
Projection only (*)
Projection and Selection

Correct.

24. What would you use in the SELECT clause to return all the Mark for
columns in the table?

Review
(1) Points

An asterisk (*) (*)


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

Correct.

Section 16
(Answer all questions in this section)

25. The EMPLOYEES table contains these columns: Mark for

LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25) Review
EMAIL VARCHAR2(50) (1) Points

You are writing a SELECT statement to retrieve the names of


employees that have an email address.

SELECT last_name||', '||first_name "Employee Name"


FROM employees;

Which WHERE clause should you use to complete this


statement?

WHERE email = NULL;


WHERE email != NULL;
WHERE email IS NULL;
WHERE email IS NOT NULL; (*)

Incorrect. See Section 16 Lesson 3.

26. If you write queries using the BETWEEN operator, it does not Mark for
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? Review
(1) Points

True
False (*)

Correct.

27. Which clause would you include in a SELECT statement to Mark for
restrict the data returned to only the employees in
department 10?
Review
(1) Points

WHERE (*)
FROM
SELECT
IS

Correct.

28. When using the LIKE condition, which symbol represents Mark for
any sequence of characters of any length--zero, one, or
more characters?
Review
(1) Points

_
% (*)
#
&

Correct.

29. You need to combine the FIRST_NAME and LAST_NAME Mark for
columns in the EMPLOYEES table and display the columns as
a combined character string. Which operator should you
use? Review
(1) Points

+
|
|| (*)
AND

Correct.

30. Which comparison operator searches for a specified Mark for


character pattern?

Review
(1) Points
IN
LIKE (*)
BETWEEN...AND...
IS NULL

Correct.

31. Which Mark for Review


of the
followin
g (1) Points
elemen
ts
cannot
be
include
d in a
WHERE
clause?

A column alias (*)


A column name
A comparison condition
A constant

Correct.

32. When using the LIKE condition to search for _ symbols, which Mark for
character can you use as the default ESCAPE option?

Review
(1) Points

%
^
&
\ (*)

Correct.

33. Evaluate this SELECT statement: Mark for

SELECT *
FROM employees Review
WHERE department_id IN(10, 20, 30) (1) Points
AND salary > 20000;

Which values would cause the logical condition to return TRUE?

DEPARTMENT_ID = 10 and SALARY = 20000


DEPARTMENT_ID = 20 and SALARY = 20000
DEPARTMENT_ID = null and SALARY = 20001
DEPARTMENT_ID = 10 and SALARY = 20001 (*)

Correct.

34. Which of the following commands will display the last name Mark for
concatenated with the job ID from the employees table, separated
by a comma and space, and label the resulting column "Employee
and Title"? 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;

Correct.

35. Evaluate this SELECT statement: Mark for

SELECT last_name, first_name, salary


FROM employees; Review
(1) Points
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.
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.

36. Which SELECT statement will display both unique and non-unique Mark for
combinations of the MANAGER_ID and DEPARTMENT_ID values from
the EMPLOYEES table?
Review
(1) Points

SELECT manager_id, department_id DISTINCT FROM


employees;
SELECT manager_id, department_id FROM employees; (*)
SELECT DISTINCT manager_id, department_id FROM
employees;
SELECT manager_id, DISTINCT department_id FROM
employees;

Correct.
Section 17
(Answer all questions in this section)

37. The ORDER BY clause always comes last. True or False? Mark for

Review
(1) Points

True (*)
False

Correct.

38. Which of the following best describes the meaning of the LIKE Mark for
operator?

Review
(1) Points

Display rows based on a range of values.


To test for values in a list.
Match a character pattern. (*)
To find Null values.

Correct.

39. 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

Correct.

40. You need to change the default sort order of the ORDER BY clause Mark for
so that the data is displayed in reverse alphabetical order. Which
keyword should you include in the ORDER BY clause?
Review
(1) Points

DESC (*)
ASC
SORT
CHANGE
Correct.
41. Which Mark for Review
stateme
nt about
the (1) Points
default
sort
order is
true?

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.

Correct.

42. 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. (*)

Correct.

43. Which SELECT statement should you use to limit the display of Mark for
product information to those products with a price of less than 50?

Review
(1) Points

SELECT product_id, product_name


FROM products
WHERE price < 50;

(*)

SELECT product_id, product_name


FROM products
HAVING price < 50;
SELECT product_id, product_name
FROM products
WHERE price <= 50;
SELECT product_id, product_name
FROM products
GROUP BY price < 50;
SELECT product_id, product_name
FROM products
WHERE price < 50.00
GROUP BY price;
Correct.

44. What value will the following SQL statement return? Mark for

SELECT employee_id
FROM employees Review
WHERE employee_id BETWEEN 100 AND 150 (1) Points
OR employee_id IN(119, 175, 205)
AND (employee_id BETWEEN 150 AND 200);

19
No rows will be returned
100, 101, 102, 103, 104, 107, 124, 141, 142, 143, 144, 149
(*)
200, 201, 202, 203, 204, 205, 206

Correct.

45. Evaluate this SELECT statement: Mark for

SELECT *
FROM employees Review
WHERE salary > 30000 (1) Points
AND department_id = 10
OR email IS NOT NULL;

Which statement is true?

The OR condition will be evaluated before the AND condition.


The AND condition will be evaluated before the OR condition.
(*)
The OR and AND conditions have the same precedence and
will be evaluated from left to right
The OR and AND conditions have the same precedence and
will be evaluated from right to left

Correct.

46. You query the database with this SQL statement: Mark for

SELECT price
FROM products Review
WHERE price IN(1, 25, 50, 250) (1) Points
AND (price BETWEEN 25 AND 40 OR price > 50);

Which two values could the statement return? (Choose two.)

(Choose all correct answers)

1
50
25 (*)
10
250 (*)

Incorrect! See Section 17 Lesson 2.

47. You need to create a report to display all employees that were Mark for
hired on or before January 1, 1996. The data should display in this
format:
Employee Start Date and Salary Review
14837 - Smith 10-MAY-1992 / 5000 (1) Points

Which SELECT statement could you use?

SELECT employee_id || - || last_name "Employee",


hire_date || / || salary "Start Date and Salary
FROM employees
WHERE hire_date <= '01-JAN-1996';
SELECT employee_id ||' '|| last_name "Employee",
hire_date ||' '|| salary "Start Date and Salary"
FROM employees
WHERE hire_date <= 01-JAN-1996';
SELECT employee_id ||'"- "|| last_name "Employee",
hire_date ||" / "|| salary Start Date and Salary"
FROM employees
WHERE hire_date <= '01-JAN-1996';
SELECT employee_id ||' - '|| last_name 'Employee',
hire_date ||' / '|| salary 'Start Date and Salary"
FROM employees
WHERE hire_date <= '01-JAN-1996';
SELECT employee_id ||' - '|| last_name "Employee",
hire_date ||' / '|| salary "Start Date and Salary"
FROM employees
WHERE hire_date <= '01-JAN-1996';

(*)

Incorrect! See Section 17 Lesson 2.

48. The PLAYERS table contains these columns: Mark for

PLAYERS TABLE:
LAST_NAME VARCHAR2 (20) Review
FIRST_NAME VARCHAR2 (20) (1) Points
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;

Correct.

49. The EMPLOYEES table contains these columns: Mark for

EMPLOYEE_ID NUMBER(9) PK
LAST_NAME VARCHAR2(25) Review
FIRST_NAME VARCHAR2(25) (1) Points
DEPARTMENT_ID NUMBER(9)
Compare these two SQL statements:

1.
SELECT DISTINCT department_id DEPT, last_name, first_name
FROM employees
ORDER BY department_id;

2.
SELECT department_id DEPT, last_name, first_name
FROM employees
ORDER BY DEPT;

How will the results differ?

One of the statements will return a syntax error.


One of the statements will eliminate all duplicate
DEPARTMENT_ID values.
There is no difference in the result between the two
statements.
The statements will sort on different column values. (*)

Incorrect! See Section 17 Lesson 3.

50. The PLAYERS table contains these columns: Mark for

PLAYERS TABLE:
LAST_NAME VARCHAR2 (20) Review
FIRST_NAME VARCHAR2 (20) (1) Points
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?

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;

Correct.

Potrebbero piacerti anche