Escolar Documentos
Profissional Documentos
Cultura Documentos
Review your answers, feedback, and question scores below. An asterisk (*) indica
tes a correct answer.
Semester 1 Final Exam covers Sections 11-17 of Database Design.
Section 15
(Answer all questions in this section)
1. What would you use in the SELECT clause to return all the columns in the t
able? Mark for Review
(1) Points
An asterisk (*) (*)
A minus sign (-)
A plus sign (+)
The ALL keyword
Correct.
2. Evaluate this SELECT statement:
SELECT (salary * raise_percent) raise
FROM employees;
If the RAISE_PERCENT column only contains null values, what will the statement r
eturn?
Mark for Review
(1) Points
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
Incorrect. See Section 15 Lesson 1.
3. When listing columns in the SELECT list, what should you use to separate t
he columns? Mark for Review
(1) Points
Commas (*)
Semicolons
Dashes
Underscores
Correct.
4. The EMPLOYEES table contains these columns:
SALARY NUMBER(7,2)
BONUS NUMBER(7,2)
COMMISSION_PCT NUMBER(2,2)
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?
Mark for Review
(1) Points
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.
Incorrect. See Section 15 Lesson 1.
5. Which SQL statement will return an error? Mark for Review
(1) Points
SEL * FR sky; (*)
select star from sky;
SELECT star FROM sky;
SELECT * FROM sky;
Correct.
6. You query the database with this SQL statement:
SELECT *
FROM transaction
Section 16
(Answer all questions in this section)
8. The EMPLOYEES table contains these columns:
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
EMAIL VARCHAR2(50)
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?
Mark for Review
(1) Points
WHERE email = NULL;
WHERE email != NULL;
Page 1 of 5
Review your answers, feedback, and question scores below. An asterisk (*) indica
(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.
14. What does the DISTINCT keyword do when it is used in a SELECT clause? Ma
rk 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.
15. When using the LIKE condition, which symbol represents any sequence of no
ne, one or more characters? Mark for Review
(1) Points
_
% (*)
#
&
Incorrect. See Section 16 Lesson 1.
16. Which of the following elements cannot be included in a WHERE clause? Ma
rk for Review
(1) Points
A column alias (*)
A column name
A comparison condition
A constant
Correct.
17. Which comparison operator searches for a specified character pattern? Ma
rk for Review
(1) Points
IN
LIKE (*)
BETWEEN...AND...
IS NULL
Incorrect. See Section 16 Lesson 1.
18. Where in a SQL statement can you not use arithmetic operators? Mark for
Review
(1) Points
SELECT
FROM (*)
WHERE
NONE
Incorrect. See Section 16 Lesson 1.
19. Which comparison condition would you use to select rows that match a char
acter pattern? Mark for Review
(1) Points
IN
LIKE (*)
ALMOST
SIMILAR
Incorrect. See Section 16 Lesson 1.
20. The Concatenation Operator does which of the following? Mark for Review
(1) Points
Links rows of data together inside the database.
Links two or more columns or literals to form a single output column (*)
Is represented by the asterisk (*) symbol
Separates columns.
Incorrect. See Section 16 Lesson 1.
Page 2 of 5
Review your answers, feedback, and question scores below. An asterisk (*) indica
tes a correct answer.
Semester 1 Final Exam covers Sections 11-17 of Database Design.
Section 12
(Answer all questions in this section)
21. What command will return data from the database to you? Mark for Review
(1) Points
FETCH
GET
SELECT (*)
RETURN
Incorrect. Refer to Section 12 Lesson 1.
22. 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.
23. 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.
24. The f_customers table contains the following data:
ID Name Address City State Zip
1 Cole Bee 123 Main Street Orlando FL 32838
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?
Mark for Review
(1) Points
0
3
1 (*)
2
Incorrect. Refer to Section 12 Lesson 2.
25. The SQL statement ALTER TABLE EMPLOYEES DELETE COLUMN SALARY is a valid s
tatement. True or False? Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 12 Lesson 2.
Section 11
(Answer all questions in this section)
26. 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.
27. 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
Incorrect. Refer to Section 11 Lesson 2.
28. The transformation from an ER diagram to a physical design involves chang
ing terminology. Secondary Unique Identifiers become Mark for Review
(1) Points
Columns
Tables
Unique Constraints (*)
Primary Key Constraints
Incorrect. Refer to Section 11 Lesson 2.
29. A table must have at least one candidate key, as well as its primary key.
True or False? Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 11 Lesson 1.
30. If a primary key is a set of columns then one column must be null. True o
r False? Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 11 Lesson 1.
Page 3 of 5
Review your answers, feedback, and question scores below. An asterisk (*) indica
tes a correct answer.
Semester 1 Final Exam covers Sections 11-17 of Database Design.
Section 11
(Answer all questions in this section)
31. A foreign key cannot refer to a primary key in the same table. True or Fa
lse? Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 11 Lesson 1.
32. A table must have a primary key. True or False? Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 11 Lesson 1.
33. Identify all of the incorrect statements that complete this sentence: A p
rimary key is: (Choose three) Mark for Review
(1) Points
(Choose all correct answers)
Section 17
(Answer all questions in this section)
36. Evaluate this SELECT statement:
SELECT first_name, last_name, email
FROM employees
ORDER BY last_name;
Which statement is true?
Mark for Review
(1) Points
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 value
s.
The rows will be sorted alphabetically by the FIRST_NAME and then the LAST_N
AME values
Incorrect! See Section 17 Lesson 2.
37. Evaluate this SELECT statement:
SELECT last_name, first_name, salary
FROM employees;
How will the results of this query be sorted?
Mark for Review
(1) Points
The database will display the rows in whatever order it finds it in the data
base, so no particular order. (*)
The results will be sorted ascending by the LAST_NAME column only.
The results will be sorted ascending by LAST_NAME and FIRST_NAME only.
The results will be sorted ascending by LAST_NAME, FIRST_NAME, and SALARY.
Correct.
38. Evaluate this SELECT statement:
SELECT *
FROM employees
WHERE department_id = 34
OR department_id = 45
OR department_id = 67;
Which operator is the equivalent of the OR conditions used in this SELECT statem
ent?
Mark for Review
(1) Points
IN (*)
AND
LIKE
BETWEEN... AND ...
Correct.
39. You query the database with this SQL statement:
SELECT price
FROM products
WHERE price IN(1, 25, 50, 250)
AND (price BETWEEN 25 AND 40 OR price > 50);
Which two values could the statement return? (Choose two.)
Mark for Review
(1) Points
(Choose all correct answers)
1
50
25 (*)
10
250 (*)
Incorrect! See Section 17 Lesson 2.
40. Evaluate this SELECT statement:
SELECT employee_id, last_name, first_name, salary
FROM employees
WHERE salary IS NOT NULL
ORDER BY last_name, 3;
Yearly Salary'
Page 4 of 5
Review your answers, feedback, and question scores below. An asterisk (*) indica
tes a correct answer.
Semester 1 Final Exam covers Sections 11-17 of Database Design.
Section 17
(Answer all questions in this section)
(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;
Correct.
45. 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.
46. 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.
Incorrect. See Section 17 Lesson 1.
47. Which comparison condition means ?Less Than or Equal To"? Mark for Revie
w
(1) Points
"=)"
"+<"
">="
"<=" (*)
Page 5 of 5