0% found this document useful (0 votes)
219 views

Oracle Database Design Final Exam

1. Object names in a database cannot start with a number and must begin with a letter. To resolve a many-to-many relationship in a physical data model, an intersection table is created. System documentation should be developed throughout the system development life cycle rather than just at the end.

Uploaded by

Naisha Mehla
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
219 views

Oracle Database Design Final Exam

1. Object names in a database cannot start with a number and must begin with a letter. To resolve a many-to-many relationship in a physical data model, an intersection table is created. System documentation should be developed throughout the system development life cycle rather than just at the end.

Uploaded by

Naisha Mehla
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Section 11

(Answer all questions in this section)

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

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

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


changing terminology. Secondary Unique Identifiers become

Review
(1) Points

Columns

Tables

Unique Constraints (*)

Primary Key Constraints

Correct

3. In a physical data model, a relationship is represented as a combination of: Mark for


(Choose Two)

Review
(1) Points

(Choose all correct answers)

Column

Primary Key or Unique Key (*)

Check Constraint or Unique Key

Foreign Key (*)

Correct

4. To resolve a many to many relationship in a physical model you create a/an Mark for
___________________?

Review
(1) Points

Unique key constraints

Intersection entity

Intersection table (*)


Two tables with Foreign key constraints between them

Correct

5. In a conceptual model, many-to-many relationships are resolved via a Mark for


structure called a/an: ________________

Review
(1) Points

Supertype

Intersection Table

Intersection Entity (*)

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

9. A table must have a primary key. True or False? Mark for

Review
(1) Points
True

False (*)

Correct

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

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

Build and Transition


Strategy and Analysis

Design and Production

Transition and Production (*)

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

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?

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;

Why would you use this statement? Review


(1) Points

To insert data

To view data (*)

To display the table structure

To delete data

Correct.

20. Evaluate this SELECT statement: Mark for

SELECT (salary * raise_percent) raise


FROM employees; Review
(1) Points
If the RAISE_PERCENT 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.
Section 15
(Answer all questions in this section)

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.

22. The EMPLOYEES table contains these columns: Mark for

SALARY NUMBER(7,2)
BONUS NUMBER(7,2) Review
COMMISSION_PCT NUMBER(2,2) (1) Points

All three columns contain values greater than zero.


There is one row of data in the table and the values are as follows:
Salary = 500, Bonus = 50, Commission_pct = .5

Evaluate these two SQL statements:

1.
SELECT salary + bonus + commission_pct * salary - bonus AS income
FROM employees;

2.
SELECT (salary + bonus ) + commission_pct * (salary - bonus) income
FROM employees;

What will be the result?

Statement 1 will return a higher value than statement 2.

Statement 2 will return a higher value than statement 1. (*)

Statement 1 will display a different column heading.

One of the statements will NOT execute.

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

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.

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

Section 16
(Answer all questions in this section)

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

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

WHERE last_name LIKE 'Sm%' (*)

WHERE last_name LIKE '%Sm'

WHERE last_name LIKE '_Sm'

WHERE last_name LIKE 'Sm_'

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.

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

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

WHERE department_id < 50 <br> AND salary BETWEEN 10000 AND


25000
WHERE department_id > 50
AND salary BETWEEN 10000 AND 25000
WHERE department_id = 50
AND salary BETWEEN 25001 AND 10001
WHERE department_id = 50
AND salary BETWEEN 10000 AND 25000
(*)

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)

37. Evaluate this SQL statement: Mark for

SELECT e.employee_id, e.last_name, e.first_name, m.manager_id


FROM employees e, employees m Review
ORDER BY e.last_name, e.first_name (1) Points
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.

Correct.

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

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

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

Arithmetic, Concatenation, Comparison, OR (*)

NOT, AND, OR, Arithmetic

Arithmetic, NOT, Logical, Comparison

Arithmetic, NOT, Concatenation, Logical

Correct.

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

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.

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

TRUE AND TRUE return FALSE

TRUE AND FALSE return TRUE

FALSE AND TRUE return NULL

TRUE AND FALSE return FALSE (*)

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.

46. Evaluate this SELECT statement: Mark for

SELECT last_name, first_name, email


FROM employees Review
ORDER BY email; (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.

Correct.

47. Evaluate this SELECT statement: Mark for

SELECT last_name, first_name, department_id, manager_id


FROM employees; 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.

48. Evaluate this SELECT statement: Mark for

SELECT first_name, last_name, email


FROM employees Review
ORDER BY last_name; (1) Points

Which statement is true?

The rows will not be sorted.

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.

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

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?

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';

(*)

Correct.

You might also like