Design Final 1
Design Final 1
com
Section 12 Lesson 1(Answer all questions in this section) 1. A table must have at least
one candidate key, as well as its primary key. True or False?
True
False
False
3. 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/her a letter requesting the
return of the BOOKS, which will require extra programming to enforce.
Entity integrity
User-defined integrity
Column integrity
Referential integrity
4. The explanation below is a User Defined integrity rule and must therefore be
manually coded, the Database cannot enforce this rule automatically: A primary key must be
unique, and no part of the primary key can be null. True or False?
True
False
Section 12 Lesson 2(Answer all questions in this section) 5. Attributes
become tables in a database. True or False?
True
False
6. Why would this table name NOT work in an Oracle database?
This_year_end+next_year
Table names must begin with an alphabetic character
Too long
Foreign Key
Section 12 Lesson 3(Answer all questions in this section) 8. The Oracle
Database can implement a many to many relationship. You simple create two foreign keys
between the two tables. True or False?
True
False
9. What do you create when you transform a many to many relationship from your ER
diagram into a physical design?
Unique key constraints
Intersection entity
Intersection table
False
Section 12 Lesson 4(Answer all questions in this section) 11. When mapping supertypes,
relationships at the supertype level transform as usual. Relationships at subtype level are
implemented as foreign keys, but the foreign key columns all become mandatory. True or False?
True
This watermark does not appear in the registered version - http://www.clicktoconvert.com
False
Section 13 Lesson 1(Answer all questions in this section) 12. What
command will return data from the database to you?
FETCH
GET
SELECT
RETURN
13. The _______ clause can be added to a select statement to return a subset of the
data.
ANYWHERE
WHICH
WHERE
EVERY
Section 16 Lesson 1(Answer all questions in this section) 14. You want
to create a list of all albums that have been produced by the company. The list should include the
title of the album, the artist's name, and the date the album was released. The ALBUMS table
includes the following columns:
SELECT *
FROM albums;
SELECT *
FROM album;
15. In the default order of precedence, which operator would be evaluated first?
Subtractions
Multiplications
Additions
Divisions
16. Evaluate this SELECT statement:
If the RAISE_PERCENT column only contains null values, what will the statement return?
Only zeroes
A null value or a numeric value depending on the value of the SALARY column
17. What would you use in the SELECT clause to return all the columns in the table?
an asterisk (*)
Manipulation
Joining
Selection
This watermark does not appear in the registered version - http://www.clicktoconvert.com
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:
1.
SELECT salary + bonus + commission_pct * salary - bonus AS income
FROM employees;
2.
SELECT (salary + bonus ) + commission_pct * (salary - bonus) income
FROM employees;
Selection only
Projection only
Section 16 Lesson 3(Answer all questions in this section) 21. In a SELECT statement
Additions are evaluated before Multiplications. True or False?
This watermark does not appear in the registered version - http://www.clicktoconvert.com
True
False
22. All computers in the world speaks the same languages, so you only need to learn one
programming language - Oracle SQL. True or False?
True
False
Section 17 Lesson 1(Answer all questions in this section) 23. Which
statement best describes how column headings are displayed by default in Oracle Application
Express:
Column headings are displayed left-justified and in lowercase.
"=>"
>=
!=
Separates columns.
26. 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?
ONLY
This watermark does not appear in the registered version - http://www.clicktoconvert.com
UNIQUE
DISTINCT
DISTINCTROW
27. What does the DISTINCT keyword do when it is used in a SELECT clause?
Mark for Review
(1) Points
Hides NULL values
WHERE department_id = 50
AND salary BETWEEN 25001 AND 10001
WHERE department_id = 50
AND salary BETWEEN 25000 AND 10000
Section 17 Lesson 2(Answer all questions in this section) 29. You need
to display all the values in the EMAIL column that contains the underscore (_) character as part
of that email address. The WHERE clause in your SELECT statement contains the LIKE
operator. What must you include in the LIKE operator?
The ESCAPE option (\) and one or more percent signs (%)
How will the heading for the SALARY 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.
Section 17 Lesson 2(Answer all questions in this section) 31. Which SELECT
statement will display both unique and non-unique combinations of the MANAGER_ID
and DEPARTMENT_ID values from the EMPLOYEES table?
SELECT manager_id, department_id DISTINCT FROM employees;
The first statement will NOT display values from all of the rows in the EMPLOYEE table
ASC
SORT
CHANGE
38. Which clause would you include in a SELECT statement to sort the rows
returned by the LAST_NAME column?
ORDER BY
WHERE
FROM
HAVING
NULL
NULLIF
REPLACE
Section 18 Lesson 1(Answer all questions in this section) 41. Which logical operator
returns TRUE if either condition is true?
This watermark does not appear in the registered version - http://www.clicktoconvert.com
OR
AND
NOT
BOTH
False
Section 18 Lesson 2(Answer all questions in this section) 43. Evaluate
this SELECT statement:
SELECT *
FROM employees
WHERE salary > 30000 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
44. Evaluate this SELECT statement:
The database will display the rows in whatever order it finds it in the database, so no
particular order.
SELECT *
FROM employees
WHERE department_id = 34
OR department_id = 45
OR department_id = 67;
Which operator is the same as the OR conditions used in this SELECT statement?
IN
AND
LIKE
SELECT price
FROM products
WHERE price IN(1, 25, 50, 250)
AND (price BETWEEN 25 AND 40 OR price > 50);
50
25
10
250
This watermark does not appear in the registered version - http://www.clicktoconvert.com
100
Section 18 Lesson 3(Answer all questions in this section) 49. Evaluate
this SQL statement:
This statement fails when executed. Which change will correct the problem?
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?