Sie sind auf Seite 1von 16

1. Foreign keys must be null. True or False?

Mark for Review


(1) Points
True
False (*)

Correct

2. A table must have a primary key. True or False? Mark for Review
(1) Points
True
False (*)

Correct

3. Identify all of the incorrect statements that complete this sentence: A pr


imary key is: (Choose three) Mark for Review
(1) Points
(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 tab
le
A set of columns in one table that uniquely identifies each row in another t
able (*)
Only one column that must be null (*)

Correct

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

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

Correct

6. In a physical data model, a relationship is represented as a combination o


f: (Choose Two) Mark for Review
(1) Points
(Choose all correct answers)
Column
Primary Key or Unique Key (*)
Check Constraint or Unique Key
Foreign Key (*)

Correct

7. In an Oracle database, why would 1_TABLE not work as a table name? Mark f
or 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

8. Attributes become tables in a database. True or False? Mark for Review


(1) Points
True
False (*)

Incorrect. Refer to Section 11 Lesson 2.

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

10. The Oracle Database can implement a many to many relationship. You simply
create two foreign keys between the two tables. True or False? Mark for Review
(1) Points
True
False (*)

Correct

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

Section 12

12. What command will return data from the database to you? Mark for Review
(1) Points
FETCH
GET
SELECT (*)
RETURN

Correct.

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

Correct.

14. The DESCRIBE command returns all rows from a table. True or False? Mark
for Review
(1) Points
True
False (*)

Correct.

15. The SQL statement ALTER TABLE EMPLOYEES DELETE COLUMN SALARY is a valid s
tatement. True or False? Mark for Review
(1) Points
True
False (*)

Correct.

16. Once you have created a table, it is not possible to alter the definition
of it. If you need to add a new column you must delete the table definition and
create a new, correct table. True or False? Mark for Review
(1) Points

True
False (*)

Incorrect. Refer to Section 12 Lesson 2.

Section 13
17. System Documentation is developed right at the end once the system has go
ne live and users have been using it for a little while. You are more likely to
get it correct that way. True or False? Mark for Review
(1) Points
True
False (*)

Correct.

18. During which phases of the System Development Life Cycle would you test t
he system before rolling it out to the users? Mark for Review
(1) Points
Build and Transition
Strategy and Analysis
Design and Production
Transition and Production (*)

Correct.

Section 15
19. 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;
(*)

SELECT alb_title, alb_artist, alb_dates


FROM album;

SELECT alb_title, alb_artist, alb_dates


FROM albums;

SELECT alb_title; alb_artist; alb_date


FROM albums;

Correct.
20. Which statement best describes how arithmetic expressions are handled? M
ark for Review
(1) Points
Addition operations are handled before any other operations.
Multiplication and subtraction operations are handled before any other opera
tions.
Multiplication and addition operations are handled before subtraction and di
vision operations.
Division and multiplication operations are handled before subtraction and ad
dition operations. (*)

Incorrect. See Section 15 Lesson 1.

21. Which SQL keyword specifies that an alias will be substituted for a column
name in the output of a SQL query? Mark for Review
(1) Points
AS (*)
OR
AND
SUBSTITUTE

Incorrect. See Section 15 Lesson 1.

22. You query the database with this SQL statement:


SELECT *
FROM transaction
WHERE product_id = 4569;
Which SQL SELECT statement capabilities are achieved when this statement is exec
uted?
Mark for Review
(1) Points
Selection only (*)
Projection only
Selection and projection only
Projection, selection and joining

Correct.

23. In the default order of precedence, which operator would be evaluated fir
st? Mark for Review
(1) Points
Subtractions and Addition are at the same level and would be evaluated first
based on left to right order
Multiplications and Division are at the same level and would be evaluated fi
rst based on left to right order (*)
Additions and Multiplications are at the same level and would be evaluated f
irst based on left to right order
Divisions and Subtractions are at the same level and would be evaluated firs
t based on left to right order

Correct.

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

Incorrect. See Section 15 Lesson 1.

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

Incorrect. See Section 16 Lesson 1.

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

Incorrect. See Section 16 Lesson 1.

27. You need to combine the FIRST_NAME and LAST_NAME columns in the EMPLOYEES
table and display the columns as a combined character string. Which operator sh
ould you use? Mark for Review
(1) Points
+
|
|| (*)
AND

Incorrect. See Section 16 Lesson 1.

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

Correct.

29. You need to display employees whose salary is in the range of 10000 throu
gh 25000 for employees in department 50 . What does the WHERE clause look like?
Mark for Review
(1) Points
WHERE department_id < 50
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 25000 AND 10000
(*)

Incorrect. See Section 16 Lesson 1.

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

31. Which SELECT 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.

32. 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'
WHERE last_name LIKE 'Sm_'

Correct.

33. Which of the following commands will display the last name concatenated w
ith the job ID from the employees table, separated by a comma and space, and lab
el the resulting column "Employee and Title"? Mark for 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.

34. Evaluate this SELECT statement:


SELECT *
FROM employees
WHERE department_id IN(10, 20, 30)
AND salary > 20000;
Which values would cause the logical condition to return TRUE?
Mark for Review
(1) Points
DEPARTMENT_ID = 10 and SALARY = 20000
DEPARTMENT_ID = 20 and SALARY = 20000
DEPARTMENT_ID = null and SALARY = 20001
DEPARTMENT_ID = 10 and SALARY = 20001 (*)

Incorrect. See Section 16 Lesson 2.

35. Any Non-UID must be dependant on the entire UID. True or False? Mark for
Review
(1) Points
True (*)
False

Correct

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

Section 17
37. The ORDER BY clause always comes last. True or False? Mark for Review
(1) Points
True (*)
False

Correct.

38. Which logical operator returns TRUE if either condition is true? Mark fo
r Review
(1) Points
OR (*)
AND
NOT
BOTH

Correct.

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

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

Incorrect. See Section 17 Lesson 1.


41. Which comparison condition means "Less Than or Equal To"? Mark for Review
(1) Points
"=)"
"+<"
">="
"<=" (*)

Correct.

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

43. Evaluate this SELECT statement:


SELECT last_name, first_name, email
FROM employees
ORDER BY email;
If the EMAIL column contains null values, which statement is true?
Mark for Review
(1) Points
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.

Incorrect! See Section 17 Lesson 2.


44. 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
WHERE "Category" = 5570 (*)

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 for Review
(1) Points
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.

46. 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
WHERE salary IS NOT NULL
ORDER BY last_name, 3;

Correct.

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

Correct.

48. The PLAYERS table contains these columns:


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 want to display all players' names with position 6900 or greater. You want t
he players names to be displayed alphabetically by last name and then by first n
ame. Which statement should you use to achieve the required results?
Mark for Review
(1) Points
SELECT last_name, first_name
FROM players
WHERE position_id >= 6900
ORDER BY last_name, first_name;
(*)

SELECT last_name, first_name


FROM players
WHERE position_id > 6900
ORDER BY last_name, first_name;

SELECT last_name, first_name


FROM players
WHERE position_id <= 6900
ORDER BY last_name, first_name;

SELECT last_name, first_name


FROM players
WHERE position_id >= 6900
ORDER BY last_name DESC, first_name;

Incorrect! See Section 17 Lesson 3.

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

Incorrect! See Section 17 Lesson 3.

50. The PLAYERS table contains these columns:


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 i
s in the range from 25000 through 100000 and whose team id is in the range of 12
00 through 1500. The results must be sorted by team id from lowest to highest an
d then further sorted by salary from highest to lowest. Which statement should y
ou use to display the desired result?
Mark for Review
(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.

Das könnte Ihnen auch gefallen