Oracle Database Design Final Exam
Oracle Database Design Final Exam
1. In an Oracle database, why would 1_TABLE not work as a table name? Mark for
Review
(1) Points
Object names must not start with a number. They must begin with a
letter. (*)
TABLE is a reserved word.
Correct
Review
(1) Points
Columns
Tables
Correct
Review
(1) Points
Column
Correct
4. To resolve a many to many relationship in a physical model you create a/an Mark for
___________________?
Review
(1) Points
Intersection entity
Correct
Review
(1) Points
Supertype
Intersection Table
Subtype
Correct
6. An "Arc Implementation" can be done just like any other Relationship - you Mark for
simply add the required Foreign Keys. True or False?
Review
(1) Points
True
False (*)
Correct
7. The explanation below is a User Defined integrity rule and must, therefore, Mark for
be manually coded; the Database cannot enforce this rule automatically.
True or False?
Review
A primary key must be unique, and no part of the primary key can be null. (1) Points
True
False (*)
Correct
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
Review
(1) Points
True
False (*)
Correct
Review
(1) Points
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. (*)
Correct
Section 11
(Answer all questions in this section)
11. A table must have at least one candidate key, as well as its primary key. Mark for
True or False?
Review
(1) Points
True
False (*)
Correct
Section 12
(Answer all questions in this section)
12. System Documentation is developed right at the end once the system has Mark for
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?
Review
(1) Points
True
False (*)
Correct.
13. During which phases of the System Development Life Cycle would you test Mark for
the system before rolling it out to the users?
Review
(1) Points
Correct.
14. 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
2 Zoe Twee 1009 Oliver Avenue Boston MA 02116 (1) Points
1 (*)
Correct.
15. Once you have created a table, it is not possible to alter the definition of it. Mark for
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.
16. What command can be used to create a new row in a table in the Mark for
database?
Review
(1) Points
CREATE
NEW
ADD
INSERT (*)
Correct.
17. The DESCRIBE command returns all rows from a table. True or False? Mark for
Review
(1) Points
True
False (*)
Correct.
18. What command will return data from the database to you? Mark for
Review
(1) Points
FETCH
GET
SELECT (*)
RETURN
Correct.
Section 15
(Answer all questions in this section)
19. You query the database with this SQL statement: Mark for
SELECT * FROM students;
To insert data
To delete data
Correct.
Only zeroes
21. In a SQL statement, which clause specifies one or more columns to be Mark for
returned by the query?
Review
(1) Points
SELECT (*)
FROM
WHERE
Any of the above options; you can list columns wherever you want to in
a SELECT statement.
Correct.
SALARY NUMBER(7,2)
BONUS NUMBER(7,2) Review
COMMISSION_PCT NUMBER(2,2) (1) Points
1.
SELECT salary + bonus + commission_pct * salary - bonus AS income
FROM employees;
2.
SELECT (salary + bonus ) + commission_pct * (salary - bonus) income
FROM employees;
Correct.
23. In which clause of a SELECT statement would you specify the name of the Mark for
table or tables being queried?
Review
(1) Points
Any of the above options; you can list tables wherever you want in a
SELECT statement.
Correct.
24. You query the database with this SQL statement: Mark for
SELECT *
FROM transaction Review
WHERE product_id = 4569; (1) Points
Selection only
Projection only
Section 16
(Answer all questions in this section)
SELECT *
FROM employees Review
WHERE department_id IN(10, 20, 30) (1) Points
AND salary > 20000;
Correct.
26. Which of the following commands will display the last name concatenated Mark for
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.
27. You need to display all the employees whose last names (of any length) Mark for
start with the letters 'Sm' . Which WHERE clause should you use?
Review
(1) Points
Correct.
28. You want to retrieve a list of customers whose last names begin with the Mark for
letters 'Fr' . Which symbol should you include in the WHERE clause of your
SELECT statement to achieve the desired result?
Review
(1) Points
% (*)
Correct.
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25) Review
EMAIL VARCHAR2(50) (1) Points
Correct.
30. If you write queries using the BETWEEN operator, it does not matter in what Mark for
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.
Section 16
(Answer all questions in this section)
31. Which comparison operator searches for a specified character pattern? Mark for
Review
(1) Points
IN
LIKE (*)
BETWEEN...AND...
IS NULL
Correct.
32. You need to display employees with salaries that are at least 30000 or Mark for
higher. Which comparison operator should you use?
Review
(1) Points
>
"=>"
>= (*)
!=
Correct.
33. You need to display only unique combinations of the LAST_NAME and Mark for
MANAGER_ID columns in the EMPLOYEES table. Which keyword should you
include in the SELECT clause?
Review
(1) Points
ONLY
UNIQUEONE
DISTINCT (*)
DISTINCTROW
Correct.
34. When using the LIKE condition to search for _ symbols, which character can Mark for
you use as the default ESCAPE option?
Review
(1) Points
&
\ (*)
Correct.
35. You need to display employees whose salary is in the range of 10000 Mark for
through 25000 for employees in department 50 . What does the WHERE
clause look like?
Review
(1) Points
Correct.
36. When using the LIKE condition, which symbol represents any sequence of Mark for
characters of any length--zero, one, or more characters?
Review
(1) Points
% (*)
&
Correct.
Section 17
(Answer all questions in this section)
This statement fails when executed. Which change will correct the problem?
Correct.
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;
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?
(*)
Correct.
40. Which statement about the logical operators is true? Mark for
Review
(1) Points
Correct.
Section 17
(Answer all questions in this section)
41. From left to right, what is the correct order of Precedence? Mark for
Review
(1) Points
Correct.
42. Which of the following best describes the meaning of the LIKE operator? Mark for
Review
(1) Points
43. Which logical operator returns TRUE if either condition is true? Mark for
Review
(1) Points
OR (*)
AND
NOT
BOTH
Correct.
44. Which of the following are TRUE regarding the logical AND operator? Mark for
Review
(1) Points
Correct.
45. Which clause would you include in a SELECT statement to sort the rows Mark for
returned by the LAST_NAME column?
Review
(1) Points
ORDER BY (*)
WHERE
FROM
HAVING
Correct.
Correct.
Correct.
Correct.
SELECT *
FROM employees Review
WHERE salary > 30000 (1) Points
AND department_id = 10
OR email IS NOT NULL;
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.
50. You need to create a report to display all employees that were hired on or Mark for
before January 1, 1996. The data should display in this format:
Employee Start Date and Salary
14837 - Smith 10-MAY-1992 / 5000 Review
(1) Points
Which SELECT statement could you use?
(*)
Correct.