Sie sind auf Seite 1von 16

Test: Final Exam Semester 1

Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 11
(Answer all questions in this section)
1. In a physical data model, an attribute becomes a
_____________.

Mark for Review


(1) Points

Table
Foreign Key
Constraint
Column (*)
Correct
2. 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 (*)
Correct
3. The transformation from an ER diagram to a physical
design involves changing terminology. Secondary Unique
Identifiers become

Mark for Review


(1) Points

Columns
Tables
Unique Constraints (*)
Primary Key Constraints
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 structure called a/an: ________________

Mark for Review


(1) Points

Supertype
Intersection Table
Intersection Entity (*)
Subtype
Correct
6. The text below is an example of what constraint type?
The value in the manager_id column of the EMPLOYEES
table must match a value in the employee_id column in
the EMPLOYEES table.

Mark for Review


(1) Points

Entity integrity
User-defined integrity
Column integrity
Referential integrity (*)
Correct
7. 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
8. 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
9. A foreign key cannot refer to a primary key in the same
table. True or False?

Mark for Review


(1) Points

True
False (*)
Correct
10.A table must have a primary key. True or False?

Mark for Review


(1) Points

True
False (*)
Correct
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 11
(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?

Mark for Review


(1) Points

True
False (*)
Correct

Section 12
(Answer all questions in this section)
12.The SQL statement ALTER TABLE EMPLOYEES
DELETE COLUMN SALARY is a valid statement. True
or False?

Mark for Review


(1) Points

True
False (*)
Correct.
13.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 (*)
Correct.
14.What command will return data from the database to you?

Mark for Review


(1) Points

FETCH
GET
SELECT (*)
RETURN
Correct.
15.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.
16.The DESCRIBE command returns all rows from a table.
True or False?
True
False (*)
Correct.

Mark for Review


(1) Points

17.During which phases of the System Development Life


Cycle would you test the 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.
18.Systems are always just rolled out as soon as the
programming phase is finished. No further work is
required once the development is finished. True or False?

Mark for Review


(1) Points

True
False (*)
Correct.

Section 15
(Answer all questions in this section)
19.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
Correct.
20.Which SQL statement will return an error?

SEL * FR sky; (*)


select star from sky;
SELECT star FROM sky;
SELECT * FROM sky;
Correct.

Mark for Review


(1) Points

Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 15
(Answer all questions in this section)
21.In which clause of a SELECT statement would you
specify the name of the table or tables being queried?

Mark for 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.
22.When you use the SELECT clause to list one or two
columns only from a table and no WHERE clause, which
SQL capability is used?

Mark for Review


(1) Points

Joining only
Selection only
Projection only (*)
Projection and Selection
Correct.
23.In a SELECT clause, what is the result of 2 + 3 * 2?

Mark for Review


(1) Points

6
8 (*)
10
13
Correct.
24.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:
ALB_TITLE VARCHAR2(150) NOT NULL

Mark for Review


(1) Points

ALB_ARTIST VARCHAR2(150) NOT NULL


ALB_DATE DATE NOT NULL
Which statement can you use to retrieve the necessary
information?
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.

Section 16
(Answer all questions in this section)
25.You want to retrieve a list of customers whose last names
begin with the letters 'Fr' . Which keyword should you
include in the WHERE clause of your SELECT statement
to achieve the desired result?

Mark for Review


(1) Points

AND
IN
BETWEEN
LIKE (*)
Correct.
26.You want to determine the orders that have been placed
by customers who reside in the city of 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?
AND city = Chicago;
AND city = 'Chicago';

Mark for Review


(1) Points

WHERE city = 'Chicago'; (*)


WHERE city = Chicago;
Correct.
27.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

% (*)
~
#
*
Correct.
28.Which of the following commands will display the last
name concatenated with the job ID from the employees
table, separated by a comma and space, and label 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.
29.Which operator is used to combine columns of character
strings to other columns?

Mark for Review


(1) Points

*
/
+
|| (*)
Correct.
30.You need to display employees whose salary is in the
range of 10000 through 25000 for employees in
department 50 . What does the WHERE clause look like?

Mark for 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.
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 16
(Answer all questions in this section)
31.When using the LIKE condition, which symbol represents
any sequence of characters of any length--zero, one, or
more characters?

Mark for Review


(1) Points

_
% (*)
#
&
Correct.
32.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.
33.Which comparison operator searches for a specified
character pattern?
IN
LIKE (*)

Mark for Review


(1) Points

BETWEEN...AND...
IS NULL
Correct.
34.Which of the following elements cannot be included in a
WHERE clause?

Mark for Review


(1) Points

A column alias (*)


A column name
A comparison condition
A constant
Correct.
35.The EMPLOYEES table contains these columns:
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
EMAIL VARCHAR2(50)

Mark for Review


(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.
36.The EMPLOYEES table includes these columns:
EMPLOYEE_ID NUMBER(4) NOT NULL
LAST_NAME VARCHAR2(15) NOT NULL
FIRST_NAME VARCHAR2(10) NOT NULL
HIRE_DATE DATE NOT NULL
You want to produce a report that provides the last names,
first names, and hire dates of those employees who were

Mark for Review


(1) Points

hired between March 1, 2000, and August 30, 2000.


Which statements can you issue to accomplish this task?
SELECT last_name, first_name, hire_date
FROM employees
WHERE hire_date BETWEEN '01-MAR-2000' AND
'30-AUG-2000';
(*)
SELECT last_name, first_name, hire_date
FROM employees
WHERE hire_date BETWEEN '30-AUG-2000' AND
'01-MAR-2000';
SELECT last_name, first_name, hire_date
FROM employees
GROUP BY hire_date >= '01-MAR-2000' and
hire_date <= '30- AUG-2000';
SELECT last_name, first_name, hire_date
FROM employees
AND hire_date >= '01-MAR-2000' and hire_date <=
'30-AUG-2000';
Correct.

Section 17
(Answer all questions in this section)
37.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.
38.Which clause would you include in a SELECT statement
to sort the rows returned by the LAST_NAME column?
ORDER BY (*)
WHERE
FROM

Mark for Review


(1) Points

HAVING
Correct.
39.Which comparison condition means "Less Than or Equal
To"?

Mark for Review


(1) Points

"=)"
"+<"
">="
"<=" (*)
Correct.
40.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.
Correct.
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
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.Evaluate this SELECT statement:
SELECT first_name, last_name, email
FROM employees
ORDER BY last_name;

Mark for Review


(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.
44.What value will the following SQL statement return?
SELECT employee_id
FROM employees
WHERE employee_id BETWEEN 100 AND 150
OR employee_id IN(119, 175, 205)
AND (employee_id BETWEEN 150 AND 200);

Mark for Review


(1) Points

19
No rows will be returned
100, 101, 102, 103, 104, 107, 124, 141, 142, 143,
144, 149 (*)
200, 201, 202, 203, 204, 205, 206
Correct.
45.Evaluate this SELECT statement:
SELECT last_name, first_name, salary
FROM employees;
How will the results of this query be sorted?
The database will display the rows in whatever order
it finds it in the database, so no particular order. (*)

Mark for Review


(1) Points

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

Mark for Review


(1) Points

Which clause contains an error?


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 last_name, first_name, email
FROM employees
ORDER BY email;

Mark for Review


(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.
48.Evaluate this SQL statement:
SELECT e.employee_id, e.last_name, e.first_name,
m.manager_id

Mark for Review


(1) Points

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?
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.
49.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 the players names to be displayed alphabetically
by last name and then by first name.
Which statement should you use to achieve the required
results?
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;

Mark for Review


(1) Points

Correct.
50.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?
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.

Mark for Review


(1) Points

Das könnte Ihnen auch gefallen