Professional Documents
Culture Documents
1. SQL is the
________ standard language to access relational databases.
2. (Projection / Selection) is done by listing column names in a select lis
t of a query.
3. To remove duplications within the result set, you should use which key w
ord after the word select.
a. DISTINCT
b. UNIQUE
c. Either of the above.
d. NONE of the above.
4. Which statement(s) below would likely fail?
a. SelectT * FROM employees; (two T s in the select word)
b. SELECT * FROM employees (unless employees created with double quotes)
c. SELECT * FROM employ-
ees;
d. Select *
5. Number columns returned in queries are normally displayed (Left, Right,
Center) justified.
6. Which query(s) would return a result of 50?
a. Select (100*2+50)/5 from dual;
b. Select 100*2 +50/5 from dual;
c. Select (100)*2+(50/5) from dual;
d. Select ((100 *2)+50)/5 from dual;
7. Consider the statement:
SELECT salary + commission_pct as compensation, Commission is ||commission_pct as C
ommission FROM employees;
What is the value of the compensation and commission in the result set for a row
where the value of the salary column is 1000 and the commission_pct column is n
ull? (ignore double quotes)
a. compensation: 1000 commission: null
b. compensation: null commission: null
c. compensation: null commission: Commission is
d. compensation: 0 commission: Commission is 0
8. For a column alias to contain a space or retain case, it must (choose th
e best answer):
a. Be enclosed within the ampersand symbol.
b. Be enclosed with single quotes.
c. Be enclosed within parenthesis
d. Be enclosed with double quotes
9. A SQL query must have both a list of items following the keyword _______
__ and a data source following the keyword _____________.
10. (True / False) In the where clause of a query, the column name and value
are interchangeable on either side of the operator, therefore department_id = 9
0 or 90 = department_id is interchangeable.
11. Literal values for text or dates must be enclosed within _______________
.
12. Between 900 and 1100 would include how many integers? (199 / 200 / 201 )
(circle one)
13. A SQL condition Where manager id IN (100, 101, 201) would be equivalent t
o three compound conditions using the ( OR / AND ) operator.
14. In the LIKE operator, which symbol is used to represent a single text ch
aracter or numeric digit?
a. "_ "
b. "/"
c. "&"
d. "%"
15. Which of the following has the highest precedence? (AND , NOT, OR , all
are equal must use parenthesis
16. By default in an ORDER BY clause, where would rows with a null value app
ear? (beginning of result set, end of result set, not listed in result set)
17. To reverse the default order of a sorting operation in the ORDER BY clau
se we use which word __DESC_________.
18. A column may be sorted in an ORDER BY clause by: (circle all true answer
s)
a column name or expression in the select list.
a. a column alias in the select list.
b. a number representing the column position in the select list.
c. a column found in the data source but not in the select list.
19. Row functions return ( a value for each row in the data source, a value
for each row in the result set, always only a single value).
20. To always return capitalized text, use the function _____________.
21. The result of SELECT SUBSTR( abcdefg , 3,1) FROM dual; is
a. Abc
b. c
c. d
d. none of the above
22. The result of SELECT TRIM( x from xxAxx ) FROM dual; is
a. Axx
b. xxA
c. A
d. xAx
23. Which function(s) would result in a value of 46?
a. Select substr(46.567, 1, 2) from dual; (works because of implicit conve
rsion-not if in doubles quotes)
b. Select round( 46.567, -1) from dual;
c. Select round(46.567) from dual;
d. Select trunc(46.567) from dual;
24. To add one hour to the current time, we should use:
a. sysdate + 1
b. to_char(sysdate, HH:MI:SS )+1
c. sysdate + 1/24
d. to_char(sysdate) + 1/24
25. Which format model was used to convert 25-MAY-04 to May Twenty-Fifth, Tw
o Thousand Four?
a. TO_CHAR('25-MAY-04','DD-MON-YY'), 'Month Ddspth, Year'
b. TO_CHAR(TO_DATE('25-MAY-04','DD-MON-YY'), 'Month Dd, Year')
c. TO_DATE(TO_CHAR('25-MAY-04','Dd-Month-YYYY'), 'Month Ddspth, YYYY')
d. TO_CHAR(TO_DATE('25-MAY-04','DD-MON-YY'), 'Month Ddspth, Year')
26. In the arithmetic expression: salary*12 - 400, which operation will be e
valuated first?
27. In date formats to use Oracle s built in algorithm for determining the cen
tury digits of the year when only providing the last two digits, we should use w
hich format element? (HH, CC, RR, YY)
28. (Projection / Selection) is done by using a WHERE clause in a SQL statem
ent
29. Which of the following can be used in the SELECT statement to return all
columns of data in a table?
a. ALL
b. Columns
c. *
d. DISTINCT
30. Which of the following is the Order of Precedence for arithmetic express
ions?
a. addition, subtraction, multiplication, division
b. subtraction, multiplication, addition, division
c. division , multiplication, addition, subtraction
d. multiplication, division, addition, subtraction
31. Mr. /Ms. Steven King is an employee of our company. hich statement below
will return a list of employees in the following format?
a. SELECT 'Mr./Ms. '||first_name||' '||last_name ||' '||'is an employee of
our company.' AS "Employees"
FROM employees;
b. SELECT "Mr./Ms."||first_name||' '||last_name 'is an employee of our comp
any.' AS "Employees"
FROM employees;
c. SELECT Mr./Ms. ||first_name||' '||last_name ||' '||"is an employee of ou
r company." AS "Employees"
FROM employees;
d. SELECT 'Mr./Ms. 'first_name,last_name ||' '||'is an employee of our comp
any.'
FROM employees;
32. For a column alias to contain a space or retain the proper case, it must
:
a. Be enclosed with single quotes.
b. Be enclosed within parentheses.
c. Be enclosed with single quotes
d. Be enclosed within the ampersand symbol
33. If any column value in an arithmetic expression is null,
a. The query will create an error message.
b. The result will be zero.
c. The result is null.
d. The SQL interpreter can not process the query.
34. Which query will return three columns each with UPPER CASE column headin
gs?
a. SELECT "Department_id", "Last_name", "First_name"
FROM employees;
b. SELECT DEPARTMENT_ID, LAST_NAME, FIRST_NAME
FROM employees;
c. SELECT department_id, last_name, first_name AS UPPER CASE
FROM employees;
d. SELECT department_id, last_name, first_name
FROM employees;
35. When used in a WHERE clause, which logical condition operator will retur
n TRUE, only if both conditions are TRUE?
a. OR
b. NOT
c. AND
d. BETWEEN
36. In this database, product_id values are stored like XY01, XY02 while qua
ntity values are stored as numbers. After executing this query, which statement
below is TRUE?
SELECT quantity, product_id
FROM products
ORDER BY quantity and product_id
a. The results are sorted numerically.
b. The results are sorted first numerically then alphabetically.
c. The results are sorted first alphabetically then numerically.
d. The results are sorted alphabetically.
37. The following query will return which result?
SELECT last_name AS "Employee Name", job_id, code_number, hire_date
FROM employees
ORDER BY code_number ASC;
a. Results for the hire_date column will be displayed from smallest to larg
est date.
b. All column results will be ordered from smallest to largest value.
c. Results for the code_number column will be displayed from smallest numbe
r to largest number.
d. Only the code_number column will be returned.
38. You want to produce query results that display the last_name, first_name
, department_id and salary of all employees. Display the first_name, last_name
and department _id in ACS but for employees in the same department display the s
alary results in descending order. Also, if two employees have the same last_nam
e, you want the first names to be displayed in ascending order.
a. ORDER BY department_id, salary ASC, last_name, first_name DESC;
b. ORDER BY last_name, first_name,department_id, salary DESC
c. ORDER BY department_id, salary, last_name, first_name DESC;
d. ORDER BY department_id DESC, salary , last_name||' '||first_name ASC
39. In the following query, what will be evaluated first?
SELECT job_id, salary, hire_date
FROM employees
WHERE salary = 4000 OR job_id = 'AD_PRES' AND hire_date LIKE '03-JUN-04';
a. job_id = 'AD_PRES' AND hire_date LIKE '03-JUN-04';
b. salary = 4000 OR job_id = 'AD_PRES
c. salary = 4000
d. LIKE '03-JUN-04'
40. In the LIKE operator, which symbols can be used?
a. & and %
b. % and _
c. $ and /
d. * and _
41. The following query will return what values?
SELECT employee_id "number", salary "pay"
FROM employees
WHERE employee_id = 103 OR salary = 4000;
a. All employees plus those with employee id's of 103 whose salary is 4000.
b. Only employees with employee id's of 103 whose salary is 4000.
c. Any employee with an employee_id of 103 and also any employee whose sala
ry is 4000.
d. Employees with an employee_id equal to " number" whose salary values are
also equal to "pay".
42. What value(s) could be displayed?
SELECT prefix
FROM phone
WHERE prefix BETWEEN 360 AND 425
OR prefix IN(515, 206, 253)
AND BETWEEN 555 AND 904);
a. 625
b. 902
c. 410
d. 499
43. Which query will display of all employees whose last names start with "S
" and have an 'ae' anywhere in their last name?
a. SELECT last_name
FROM employees
WHERE last_name LIKE '_S%ae%';
b. SELECT last_name
FROM employees
WHERE last_name LIKE 'S_ae%';
c. SELECT last_name
FROM employees
WHERE last_name LIKE 'S&ae&';
d. SELECT last_name
FROM employees
WHERE last_name LIKE 'S%ae%';
44. A column may be sorted in an ORDER BY clause by: (choose all true answer
s)
a. column name or expression in the SELECT list.
b. A column alias in the SELECT list.
c. Placing the ORDER BY clause before the SELECT statement.
d. Putting a column number in the SELECT list.
45. The following query will return which result?
SELECT last_name, job_id, department_id, hire_date
FROM employees
ORDER BY 4 DESC;
a. Only column 4 will be displayed.
b. All 4 columns will be displayed in descending order.
c. 4 columns will be displayed with hire_dates displayed with the most rece
nt dates listed first.
d. The hire_date column
46. If hire_date is 13-May-04, write the format for each example below:
TRUNC(hire_date) = _____________
TRUNC(hire_date, 'MONTH') = ___________
ROUND(hire_date, 'YEAR') = ____________
47. Make "rein" out of "reindeer"? __________________
48. How do I take the "O" off of "Oracle"? ________________
49. How can I turn 'Snowman' into ****Snowman****?
Name ______________________________
1. SQL is the ________ standard language to access relational databases.
2. (Projection / Selection) is done by listing column names in a select lis
t of a query.
3. To remove duplications within the result set, you should use which key w
ord after the word select.
a. DISTINCT
b. UNIQUE
c. Either of the above.
d. NONE of the above.
4. Which statement(s) below would likely fail?
a. SelectT * FROM employees; (two T s in the select word)
b. SELECT * FROM employees (unless employees created with double quotes)
c. SELECT * FROM employ-
ees;
d. Select *
5. Number columns returned in queries are normally displayed (Left, Right,
Center) justified.
6. Which query(s) would return a result of 50?
a. Select (100*2+50)/5 from dual;
b. Select 100*2 +50/5 from dual;
c. Select (100)*2+(50/5) from dual;
d. Select ((100 *2)+50)/5 from dual;
7. Consider the statement:
SELECT salary + commission_pct as compensation, Commission is ||commission_pct as C
ommission FROM employees;
What is the value of the compensation and commission in the result set for a row
where the value of the salary column is 1000 and the commission_pct column is n
ull? (ignore double quotes)
a. compensation: 1000 commission: null
b. compensation: null commission: null
c. compensation: null commission: Commission is
d. compensation: 0 commission: Commission is 0
8. For a column alias to contain a space or retain case, it must (choose th
e best answer):
a. Be enclosed within the ampersand symbol.
b. Be enclosed with single quotes.
c. Be enclosed within parenthesis
d. Be enclosed with double quotes
9. A SQL query must have both a list of items following the keyword _______
__ and a data source following the keyword _____________.
10. (True / False) In the where clause of a query, the column name and value
are interchangeable on either side of the operator, therefore department_id = 9
0 or 90 = department_id is interchangeable.
11. Literal values for text or dates must be enclosed within _______________
.
12. Between 900 and 1100 would include how many integers? (199 / 200 / 201 )
(circle one)
13. A SQL condition Where manager id IN (100, 101, 201) would be equivalent t
o three compound conditions using the ( OR / AND ) operator.
14. In the LIKE operator, which symbol is used to represent a single text ch
aracter or numeric digit?
a. "_ "
b. "/"
c. "&"
d. "%"
15. Which of the following has the highest precedence? (AND , NOT, OR , all
are equal must use parenthesis
16. By default in an ORDER BY clause, where would rows with a null value app
ear? (beginning of result set, end of result set, not listed in result set)
17. To reverse the default order of a sorting operation in the ORDER BY clau
se we use which word __DESC_________.
18. A column may be sorted in an ORDER BY clause by: (circle all true answer
s)
a column name or expression in the select list.
a. a column alias in the select list.
b. a number representing the column position in the select list.
c. a column found in the data source but not in the select list.
19. Row functions return ( a value for each row in the data source, a value
for each row in the result set, always only a single value).
20. To always return capitalized text, use the function _____________.
21. The result of SELECT SUBSTR( abcdefg , 3,1) FROM dual; is
a. Abc
b. c
c. d
d. none of the above
22. The result of SELECT TRIM( x from xxAxx ) FROM dual; is
a. Axx
b. xxA
c. A
d. xAx
23. Which function(s) would result in a value of 46?
a. Select substr(46.567, 1, 2) from dual; (works because of implicit conve
rsion-not if in doubles quotes)
b. Select round( 46.567, -1) from dual;
c. Select round(46.567) from dual;
d. Select trunc(46.567) from dual;
24. To add one hour to the current time, we should use:
a. sysdate + 1
b. to_char(sysdate, HH:MI:SS )+1
c. sysdate + 1/24
d. to_char(sysdate) + 1/24
25. Which format model was used to convert 25-MAY-04 to May Twenty-Fifth, Tw
o Thousand Four?
a. TO_CHAR('25-MAY-04','DD-MON-YY'), 'Month Ddspth, Year'
b. TO_CHAR(TO_DATE('25-MAY-04','DD-MON-YY'), 'Month Dd, Year')
c. TO_DATE(TO_CHAR('25-MAY-04','Dd-Month-YYYY'), 'Month Ddspth, YYYY')
d. TO_CHAR(TO_DATE('25-MAY-04','DD-MON-YY'), 'Month Ddspth, Year')
26. In the arithmetic expression: salary*12 - 400, which operation will be e
valuated first?
27. In date formats to use Oracle s built in algorithm for determining the cen
tury digits of the year when only providing the last two digits, we should use w
hich format element? (HH, CC, RR, YY)
28. (Projection / Selection) is done by using a WHERE clause in a SQL statem
ent
29. Which of the following can be used in the SELECT statement to return all
columns of data in a table?
a. ALL
b. Columns
c. *
d. DISTINCT
30. Which of the following is the Order of Precedence for arithmetic express
ions?
a. addition, subtraction, multiplication, division
b. subtraction, multiplication, addition, division
c. division , multiplication, addition, subtraction
d. multiplication, division, addition, subtraction
31. Mr. /Ms. Steven King is an employee of our company. hich statement below
will return a list of employees in the following format?
a. SELECT 'Mr./Ms. '||first_name||' '||last_name ||' '||'is an employee of
our company.' AS "Employees"
FROM employees;
b. SELECT "Mr./Ms."||first_name||' '||last_name 'is an employee of our comp
any.' AS "Employees"
FROM employees;
c. SELECT Mr./Ms. ||first_name||' '||last_name ||' '||"is an employee of ou
r company." AS "Employees"
FROM employees;
d. SELECT 'Mr./Ms. 'first_name,last_name ||' '||'is an employee of our comp
any.'
FROM employees;
32. For a column alias to contain a space or retain the proper case, it must
:
a. Be enclosed with single quotes.
b. Be enclosed within parentheses.
c. Be enclosed with single quotes
d. Be enclosed within the ampersand symbol
33. If any column value in an arithmetic expression is null,
a. The query will create an error message.
b. The result will be zero.
c. The result is null.
d. The SQL interpreter can not process the query.
34. Which query will return three columns each with UPPER CASE column headin
gs?
a. SELECT "Department_id", "Last_name", "First_name"
FROM employees;
b. SELECT DEPARTMENT_ID, LAST_NAME, FIRST_NAME
FROM employees;
c. SELECT department_id, last_name, first_name AS UPPER CASE
FROM employees;
d. SELECT department_id, last_name, first_name
FROM employees;
35. When used in a WHERE clause, which logical condition operator will retur
n TRUE, only if both conditions are TRUE?
a. OR
b. NOT
c. AND
d. BETWEEN
36. In this database, product_id values are stored like XY01, XY02 while qua
ntity values are stored as numbers. After executing this query, which statement
below is TRUE?
SELECT quantity, product_id
FROM products
ORDER BY quantity and product_id
a. The results are sorted numerically.
b. The results are sorted first numerically then alphabetically.
c. The results are sorted first alphabetically then numerically.
d. The results are sorted alphabetically.
37. The following query will return which result?
SELECT last_name AS "Employee Name", job_id, code_number, hire_date
FROM employees
ORDER BY code_number ASC;
a. Results for the hire_date column will be displayed from smallest to larg
est date.
b. All column results will be ordered from smallest to largest value.
c. Results for the code_number column will be displayed from smallest numbe
r to largest number.
d. Only the code_number column will be returned.
38. You want to produce query results that display the last_name, first_name
, department_id and salary of all employees. Display the first_name, last_name
and department _id in ACS but for employees in the same department display the s
alary results in descending order. Also, if two employees have the same last_nam
e, you want the first names to be displayed in ascending order.
a. ORDER BY department_id, salary ASC, last_name, first_name DESC;
b. ORDER BY last_name, first_name,department_id, salary DESC
c. ORDER BY department_id, salary, last_name, first_name DESC;
d. ORDER BY department_id DESC, salary , last_name||' '||first_name ASC
39. In the following query, what will be evaluated first?
SELECT job_id, salary, hire_date
FROM employees
WHERE salary = 4000 OR job_id = 'AD_PRES' AND hire_date LIKE '03-JUN-04';
a. job_id = 'AD_PRES' AND hire_date LIKE '03-JUN-04';
b. salary = 4000 OR job_id = 'AD_PRES
c. salary = 4000
d. LIKE '03-JUN-04'
40. In the LIKE operator, which symbols can be used?
a. & and %
b. % and _
c. $ and /
d. * and _
41. The following query will return what values?
SELECT employee_id "number", salary "pay"
FROM employees
WHERE employee_id = 103 OR salary = 4000;
a. All employees plus those with employee id's of 103 whose salary is 4000.
b. Only employees with employee id's of 103 whose salary is 4000.
c. Any employee with an employee_id of 103 and also any employee whose sala
ry is 4000.
d. Employees with an employee_id equal to " number" whose salary values are
also equal to "pay".
42. What value(s) could be displayed?
SELECT prefix
FROM phone
WHERE prefix BETWEEN 360 AND 425
OR prefix IN(515, 206, 253)
AND BETWEEN 555 AND 904);
a. 625
b. 902
c. 410
d. 499
43. Which query will display of all employees whose last names start with "S
" and have an 'ae' anywhere in their last name?
a. SELECT last_name
FROM employees
WHERE last_name LIKE '_S%ae%';
b. SELECT last_name
FROM employees
WHERE last_name LIKE 'S_ae%';
c. SELECT last_name
FROM employees
WHERE last_name LIKE 'S&ae&';
d. SELECT last_name
FROM employees
WHERE last_name LIKE 'S%ae%';
44. A column may be sorted in an ORDER BY clause by: (choose all true answer
s)
a. column name or expression in the SELECT list.
b. A column alias in the SELECT list.
c. Placing the ORDER BY clause before the SELECT statement.
d. Putting a column number in the SELECT list.
45. The following query will return which result?
SELECT last_name, job_id, department_id, hire_date
FROM employees
ORDER BY 4 DESC;
a. Only column 4 will be displayed.
b. All 4 columns will be displayed in descending order.
c. 4 columns will be displayed with hire_dates displayed with the most rece
nt dates listed first.
d. The hire_date column
46. If hire_date is 13-May-04, write the format for each example below:
TRUNC(hire_date) = _____________
TRUNC(hire_date, 'MONTH') = ___________
ROUND(hire_date, 'YEAR') = ____________
47. Make "rein" out of "reindeer"? __________________
48. How do I take the "O" off of "Oracle"? ________________
49. How can I turn 'Snowman' into ****Snowman****?
Section 12
1. The explanation below is a column integrity constraint:
A column must contain only values consistent with the defined data format of the
column. True or False?
Mark for Review
(1) Points
True (*)
False
Correct
Correct
3. 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 o
r False?
Mark for Review
(1) Points
True
False (*)
Correct
Constraint
Column (*)
Correct
Correct
Correct
Correct
Section 12
11. Which of the following are reasons why you should consider using a Subtyp
e Implementation? Mark for Review
(1) Points
The resulting table will reside in a single database and be used by just ONE
user.
When the common access paths for the supertypes are different.
Business functionality and business rules, access paths and frequency of acc
ess are all very different between subtypes. (*)
Most of the relationships are at the supertype level
Correct
Section 13
12. 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
Correct.
13. The DESCRIBE command returns all rows from a table. True or False? Mark
for Review
(1) Points
True
False (*)
Section 16
14. Which SQL keyword specifies that an alias will be substituted for a colum
n name in the output of a SQL query? Mark for Review
(1) Points
AS (*)
OR
AND
SUBSTITUTE
Correct.
16.
t:
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
Correct.
17. What would you use in the SELECT clause to return all the columns in the
table? Mark for Review
(1) Points
An asterisk (*) (*)
A minus sign (-)
A plus sign (+)
The ALL keyword
Correct.
18. When you use the SELECT clause to list one or two columns only from a tab
le and no WHERE clause, which SQL capability is used? Mark for Review
(1) Points
Joining only
Selection only
Projection only (*)
Projection and Selection
Correct.
13
Correct.
Correct.
Section 16
21. Any Non-UID must be dependant on the entire UID. True or False? Mark for
Review
(1) Points
True (*)
False
Correct
Section 17
23. 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
24. Which symbol represents the not equal to condition? Mark for Review
(1) Points
#
'+'
!= (*)
~
Correct.
25. Which statement best describes how column headings are displayed by defau
lt in Oracle Application Express: Mark for Review
(1) Points
Column headings are displayed left-justified and in lowercase.
Column headings are displayed left-justified and in uppercase.
Column headings are displayed centered and in uppercase. (*)
Column headings are displayed centered and in mixed case.
27. You need to display employees whose salary is in the range of 30000 and 5
0000. Which comparison operator should you use? Mark for Review
(1) Points
IN
LIKE
BETWEEN...AND... (*)
IS NULL
Correct.
28. Which clause would you include in a SELECT statement to restrict the data
returned to only the employees in department 10? Mark for Review
(1) Points
WHERE (*)
FROM
SELECT
IS
Correct.
30. What will the result of the following SELECT statement be:
SELECT last_name, salary, salary + 300
FROM employees;
How will the heading for the SALARY column appear in the display by default in O
racle Application Express?
Mark for Review
(1) Points
Display the last name, salary and the results of adding 300 to each salary f
or all the employees (*)
Modify the salary column by adding 300 and displaying the last name, salary
and the new salary.
Modify the salary column by adding 300 and only display the last name and th
e new salary.
Display the last name, salary and the results of adding 300 to the salary of
the first employee row
Section 17
31. The PLAYERS table contains these columns:
PLAYER_ID NUMBER(9)
LAST_NAME VARCHAR2(20)
FIRST_NAME VARCHAR2 (20)
TEAM_ID NUMBER (4)
MANAGER_ID NUMBER (9)
POSITION_ID NUMBER (4)
Which SELECT statement should you use if you want to display unique combinations
of the TEAM_ID and MANAGER_ID columns?
Mark for Review
(1) Points
SELECT * FROM players;
SELECT team_id, manager_id FROM players;
SELECT DISTINCT team_id, manager_id FROM players; (*)
SELECT team_id, DISTINCT manager_id FROM players;
SELECT team_id, manager_id DISTINCT FROM players;
Correct.
32. You need write a SELECT statement that should only return rows that conta
in 34, 46, or 48 for the DEPARTMENT_ID column. Which operator should you use in
the WHERE clause to compare the DEPARTMENT_ID column to this specific list of va
lues? Mark for Review
(1) Points
=
!=
IN (*)
BETWEEN..AND..
Correct.
33.
statement will display both unique and non-unique combinations of the MANAGER_ID
and DEPARTMENT_ID values from the EMPLOYEES table? Mark for 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 18
37. Evaluate this SQL statement:
SELECT e.employee_id, e.last_name, e.first_name, m.manager_id
FROM employees e, employees m
ORDER BY e.last_name, e.first_name
WHERE e.employee_id = m.manager_id;
This statement fails when executed. Which change will correct the problem?
Mark for Review
(1) Points
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.
Correct.
Correct.
42. You attempt to query the database with this SQL statement:
SELECT product_id "Product Number", category_id "Category", price "Price"
FROM products
WHERE "Category" = 5570
ORDER BY "Product Number";
This statement fails when executed. Which clause contains a syntax error?
Mark for Review
(1) Points
SELECT product_id "Product Number", category_id "Category", price "price"
ORDER BY "Product Number";
FROM products
ORDER BY last_name, 3;
Correct.
Correct.
45. 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.
46. Which comparison condition means "Less Than or Equal To?" Mark for Revie
w
(1) Points
"=)"
"+<"
">="
"<=" (*)
Correct.
47. From left to right, what is the correct order of Precedence? Mark for Re
view
(1) Points
Arithmetic, Concatenation, Comparison, OR (*)
NOT, AND, OR, Arithmetic
Arithmetic, NOT, Logical, Comparison
Arithmetic, NOT, Concatenation, Logical
Correct.
48. 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 s
tatement
Correct.
49. Which clause would you include in a SELECT statement to sort the rows ret
urned by the LAST_NAME column? Mark for Review
(1) Points
ORDER BY (*)
WHERE
FROM
HAVING
Correct.
50. You need to change the default sort order of the ORDER BY clause so that
the data is displayed in reverse alphabetical order. Which keyword should you in
clude in the ORDER BY clause? Mark for Review
(1) Points
DESC (*)
ASC
SORT
CHANGE
Correct.
Section 12
1. 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. (*)
2. 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 o
r False?
Mark for Review
(1) Points
True
False (*)
Correct
Correct
User-defined integrity
Column integrity
Referential integrity (*)
Correct
5. An "Arc Implementation" can be done just like any other Relationship - you
simply add the required Foreign Keys. True or False? Mark for Review
(1) Points
True
False (*)
Correct
6. Which of the following are reasons why you should consider using a Subtype
Implementation? Mark for Review
(1) Points
The resulting table will reside in a single database and be used by just ONE
user.
When the common access paths for the supertypes are different.
Business functionality and business rules, access paths and frequency of acc
ess are all very different between subtypes. (*)
Most of the relationships are at the supertype level
Correct
7. What do you create when you transform a many to many relationship from you
r ER diagram into a physical design? Mark for Review
(1) Points
Unique key constraints
Intersection entity
Intersection table (*)
Two tables with Foreign key constraints between them
Correct
True
False (*)
Correct
9. Why would this table name NOT work in an Oracle database? this_year_end+ne
xt_year Mark for Review
(1) Points
Table names must begin with an alphabetic character
Too long
The Plus sign + is not allowed in object names (*)
None of the above
Correct
10.
a physical design involves changing terminology. Secondary Unique Identifiers b
ecome Mark for Review
(1) Points
Columns
Tables
Unique Constraints (*)
Primary Key Constraints
Correct
Section 12
11. In a physical data model, a relationship is represented as a combination
of: (Choose Two) Mark for Review
(1) Points
(Choose all correct answers)
Column
Primary Key or Unique Key (*)
Check Constraint or Unique Key
Foreign Key (*)
Section 13
12. 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 13
13. 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
Correct.
Section 16
14. Would it be a good idea to model age as an attribute of STUDENT? Mark fo
r Review
(1) Points
Yes
Maybe it could stop us having to calculate someone's age every time we need
it
Sometimes
No - it breaks the Normalization rules (*)
When all non-UID attributes are dependent upon the entire UID. (*)
When no attritibutes are mutually independant and fully independent on the p
rimary key.
When no attritibutes are mutually independent and all are fully dependent on
the primary key.
None of the Above.
Correct
Correct.
17. 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;
18. You want to create a list of all albums that have been produced by the co
mpany. The list should include the title of the album, the artist's name, and th
e date the album was released. The ALBUMS table includes the following columns:
ALB_TITLE VARCHAR2(150) NOT NULL
ALB_ARTIST VARCHAR2(150) NOT NULL
ALB_DATE DATE NOT NULL
Which statement can you use to retrieve the necessary information?
Mark for Review
(1) Points
SELECT *
FROM albums;
(*)
Correct.
20. When listing columns in the SELECT list, what should you use to separate
the columns? Mark for Review
(1) Points
Commas (*)
Semicolons
Dashes
Underscores
Correct.
Section 17
23. Evaluate this SELECT statement:
SELECT last_name, first_name, salary
FROM employees;
How will the heading for the SALARY column appear in the display by default in O
racle Application Express?
Mark for Review
(1) Points
The heading will display with the first character capitalized and centered.
The heading will display with the first character capitalized and left justi
fied.
The heading will display as uppercase and centered. (*)
The heading will display as uppercase and left justified.
25. You want to determine the orders that have been placed by customers who r
eside in Chicago. You write this partial SELECT statement:
SELECT orderid, orderdate, total
FROM orders;
What should you include in your SELECT statement to achieve the desired results?
Mark for Review
(1) Points
AND city = Chicago;
AND city = 'Chicago';
WHERE city = 'Chicago'; (*)
WHERE city = Chicago;
Correct.
26. Which SELECT statement will display both unique and non-unique combinatio
ns of the MANAGER_ID and DEPARTMENT_ID values from the EMPLOYEES table? Mark fo
r 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;
29. If you write queries using the BETWEEN operator it does not matter in wha
t order you enter the values, i.e. BETWEEN low value AND high value will give th
e same result as BETWEEN high value and low value. True or False? Mark for Revi
ew
(1) Points
True
False (*)
Incorrect. See Section 17.
32. 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 SELE
CT clause? Mark for Review
(1) Points
ONLY
UNIQUE
DISTINCT (*)
DISTINCTROW
Correct. See Section 17
33. Which statement best describes how column headings are displayed by defau
lt in Oracle Application Express: Mark for Review
(1) Points
Column headings are displayed left-justified and in lowercase.
Column headings are displayed left-justified and in uppercase.
Column headings are displayed centered and in uppercase. (*)
Column headings are displayed centered and in mixed case.
34. You need to display employees whose salary is in the range of 30000 and 5
0000. Which comparison operator should you use? Mark for Review
(1) Points
IN
LIKE
BETWEEN...AND... (*)
IS NULL
Correct.
35. When using the LIKE condition, which symbol represents any sequence of no
ne, one or more characters? Mark for Review
(1) Points
_
% (*)
#
&
Correct.
36. Which comparison condition would you use to select rows that match a char
acter pattern? Mark for Review
(1) Points
IN
LIKE (*)
ALMOST
SIMILAR
Correct.
Section 18
37. The EMPLOYEES table contains these columns:
EMPLOYEE_ID NUMBER(9) PK
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
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?
Mark for Review
(1) Points
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.
Correct.
39. Which comparison condition means "Less Than or Equal To?" Mark for Revie
w
(1) Points
"=)"
"+<"
">="
"<=" (*)
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 18
41.
Which of the following is TRUE regarding the logical AND operator? Mark fo
r Review
(1) Points
Correct.
43.
You need to change the default sort order of the ORDER BY clause so that the dat
a is displayed in reverse alphabetical order. Which keyword should you include i
n the ORDER BY clause? Mark for Review
(1) Points
DESC (*)
ASC
SORT
CHANGE
Correct.
44.
Which clause would you include in a SELECT statement to sort the rows returned b
y the LAST_NAME column? Mark for Review
(1) Points
ORDER BY (*)
WHERE
FROM
HAVING
Correct.
45.
Evaluate this SELECT statement:
SELECT last_name, first_name, department_id, manager_id
FROM employees;
You need to sort data by manager id values and then alphabetically by employee l
ast name and first name values. Which ORDER BY clause could you use? Mark fo
r Review
(1) Points
46.
Evaluate this SELECT statement:
SELECT *
FROM employees
WHERE salary > 30000
AND department_id = 10
OR email IS NOT NULL;
Which statement is true? Mark for Review
(1) Points
The OR and AND conditions have the same precedence and will be evaluated from le
ft to right
The OR and AND conditions have the same precedence and will be evaluated from ri
ght to left
Correct.
47.
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
Correct.
48.
You attempt to query the database with this SQL statement:
SELECT product_id "Product Number", category_id "Category", price "Price"
FROM products
WHERE "Category" = 5570
ORDER BY "Product Number";
This statement fails when executed. Which clause contains a syntax error?
Mark for Review
(1) Points
FROM products
Correct.
49.
Evaluate this SELECT statement:
SELECT employee_id, last_name, first_name, salary 'Yearly Salary'
FROM employees
WHERE salary IS NOT NULL
ORDER BY last_name, 3;
Which clause contains an error? Mark for Review
(1) Points
SELECT employee_id, last_name, first_name, salary 'Yearly Salary' (*)
FROM employees
ORDER BY last_name, 3;
Correct.
50.
You need to create a report to display all employees that were hired on or after
January 1, 1996. The data should display in this format:
Employee Start Date and Salary
14837 - Smith 10-MAY-92 / 5000
Which SELECT statement could you use? Mark for Review
(1) Points
True
False (*)
Correct
2. Which of the following are reasons why you should consider using a Subtype
Implementation? Mark for Review
(1) Points
The resulting table will reside in a single database and be used by just ONE
user.
When the common access paths for the supertypes are different.
Business functionality and business rules, access paths and frequency of acc
ess are all very different between subtypes. (*)
Most of the relationships are at the supertype level
Correct
Correct
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. (*)
6. If a primary key is a set of columns then one column must be null. True or
False? Mark for Review
(1) Points
True
False (*)
Correct
7. A table must have a primary key. True or False? Mark for Review
(1) Points
True
False (*)
Correct
Correct
9. Why would this table name NOT work in an Oracle database? this_year_end+ne
xt_year Mark for Review
(1) Points
Table names must begin with an alphabetic character
Too long
The Plus sign + is not allowed in object names (*)
None of the above
Correct
Correct
Section 13
12. What command will return data from the database to you? Mark for Review
(1) Points
FETCH
GET
SELECT (*)
RETURN
Correct.
13. The DESCRIBE command returns all rows from a table. True or False? Mark
for Review
(1) Points
True
False (*)
Correct.
Section 16
14. Which SQL keyword specifies that an alias will be substituted for a colum
n name in the output of a SQL query? Mark for Review
(1) Points
AS (*)
OR
AND
SUBSTITUTE
Correct.
15. In a SQL statement, which clause specifies one or more columns to be retu
rned by the query? Mark for Review
(1) Points
SELECT (*)
FROM
WHERE
Any of the above options, you can list columns wherever you want to in a SEL
ECT statement.
Correct.
16. The SELECT statement retrieves information from the database. In a SELECT
statement, you can do all of the following EXCEPT: Mark for Review
(1) Points
Projection
Manipulation (*)
Joining
Selection
Correct.
17. When you use the SELECT clause to list one or two columns only from a tab
le and no WHERE clause, which SQL capability is used? Mark for Review
(1) Points
Joining only
Selection only
Projection only (*)
Projection and Selection
Correct.
Correct.
19. 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.
Section 16
21. Would it be a good idea to model age as an attribute of STUDENT? Mark fo
r Review
(1) Points
Yes
Maybe it could stop us having to calculate someone's age every time we need
it
Sometimes
No - it breaks the Normalization rules (*)
Correct
22. Any Non-UID must be dependant on the entire UID. True or False? Mark for
Review
(1) Points
True (*)
False
Correct
Section 17
23. You need to display all the employees whose last name starts with the let
ters Sm . Which WHERE clause should you use? Mark for Review
(1) Points
WHERE last_name LIKE 'Sm%' (*)
WHERE last_name LIKE '%Sm'
WHERE last_name LIKE '_Sm'
24. You want to retrieve a list of customers whose last names begin with the
letters Fr . Which symbol should you include in the WHERE clause of your SELECT
statement to achieve the desired result? Mark for Review
(1) Points
% (*)
~
#
*
25. If the EMPLOYEES table has the following columns, and you want to write a
SELECT statement to return the employee last name and department number for emp
loyee number 176, which of the following SQL statements should you use?
Name Type Length
EMPLOYEE_ID NUMBER 22
FIRST_NAME VARCHAR2 20
LAST_NAME VARCHAR2 25
EMAIL VARCHAR2 25
PHONE_NUMBER VARCHAR2 20
SALARY NUMBER 22
COMMISSION_PCT NUMBER 22
MANAGER_ID NUMBER 22
DEPARTMENT_ID NUMBER 22
Correct.
26. 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? Mark for Review
(1) Points
The ESCAPE option (\) and one or more percent signs (%)
The (+) operator
A percent sign (%)
The ESCAPE option (\) (*)
Correct.
29. Which comparison condition would you use to select rows that match a char
acter pattern? Mark for Review
(1) Points
IN
LIKE (*)
ALMOST
SIMILAR
Correct.
30. Which statement best describes how column headings are displayed by defau
lt in Oracle Application Express: Mark for Review
(1) Points
Column headings are displayed left-justified and in lowercase.
Column headings are displayed left-justified and in uppercase.
Column headings are displayed centered and in uppercase. (*)
Column headings are displayed centered and in mixed case.
32. Which symbol represents the not equal to condition? Mark for Review
(1) Points
#
'+'
!= (*)
~
33. 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.
35. If you write queries using the BETWEEN operator it does not matter in wha
t order you enter the values, i.e. BETWEEN low value AND high value will give th
e same result as BETWEEN high value and low value. True or False? Mark for Revi
ew
(1) Points
True
False (*)
Correct.
The first statement will NOT display values from all of the rows in the EMPL
OYEES table
The second statement could display a unique combination of the EMPLOYEE_ID,
MANAGER_ID, and DEPARTMENT_ID values more than once.
Section 18
37. Which logical operator returns TRUE if either condition is true? Mark fo
r Review
(1) Points
OR (*)
AND
NOT
BOTH
Correct.
38. Which clause would you include in a SELECT statement to sort the rows ret
urned by the LAST_NAME column? Mark for Review
(1) Points
ORDER BY (*)
WHERE
FROM
HAVING
Correct.
39. 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.
40. The ORDER BY clause always comes last. True or False? Mark for Review
(1) Points
True (*)
False
Correct.
Section 18
41. Which of the following is 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
Correct.
42. 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 s
tatement
Correct.
Correct.
Correct.
Correct.
Correct.
Correct.
Correct.
Correct.
50. Which SELECT statement should you use to limit the display of product inf
ormation to those products with a price of less than 50? Mark for Review
(1) Points
SELECT product_id, product_name
FROM products
WHERE price < 50;
(*)
Correct.
Section 12 Lesson 1(Answer all questions in this section)
1. A foreign key can not refer
to a primary key in the same table. True or False?
True
False2. Identify all of the incorrect statements that complete this sentence: A
primary key is:
(Choose Three)
(Choose all correct answers)
A single column that uniquely identifies each column in a table
One or more columns in a table that uniquely identifies each row in that table
A set of columns in one table that uniquely identifies each row in another table
Only one column that must be null
3. A table must have a primary key. True or False?
True
False4. If a primary key is a set of columns then one column must be null. True
or False?
True
False
Section 12 Lesson 2(Answer all questions in this section)
5.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
The Plus sign + is not allowed in object names
None of the above
6. The transformation from an ER diagram to a physical design involves changing
terminology. Secondary Unique Identifiers becomes
Columns
Table