Escolar Documentos
Profissional Documentos
Cultura Documentos
5. Why
Unique Constraints
Primary Key Constraints
7. In an Oracle database, why would 1_TABLE not work as a table name?
Review
(1) Points
The database does not understand all capital letters
Mark for
False
Section 12 Lesson 4 (Answer all questions in this section)
10. An "Arc
Implementation" can be done just like any other Relationship - you simply add the required
Foreign Keys. True or False?
(1) Points
True
False
Section 12 Lesson 4(Answer all questions in this section)
11. When translating an arc
relationship to a physical design, you must turn the arc relationships into foreign keys. Assuming
you are implementing an Exclusive Design, you must also create two Unique Key Constraints to
ensure the Arc is implemented correctly. True or False?
(1) Points
True
False
Section 13 Lesson 1 (Answer all questions in this section)
DESCRIBE command returns all rows from a table. True or False?
(1) Points
True
12. The
False
13. What command can used to create a new row in a table in the database?
for Review
(1) Points
CREATE
Mark
NEW
ADD
INSERT
Section 16 Lesson 1 (Answer all questions in this section)
listing columns in the SELECT list, what should you use to separate the columns?
Review
(1) Points
Commas
14. When
Mark for
Semicolons
Dashes
Underscores
15. 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
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 *
FROM album;
SELECT alb_title; alb_artist; alb_date
FROM albums;
16. Which SQL keyword specifies that an alias will be substituted for a column name in
the output of a SQL query?
(1) Points
AS
OR
AND
SUBSTITUTE
17. If a SQL statement returns data from two or more tables, which SQL capability is
being used?
(1) Points
Selection
Projection
Joining
Insertion
18. In which clause of a SELECT statement would you specify the name of the table or
tables being queried?
(1) Points
the FROM clause
computers unless you completely understand exactly how they work. True or False?
Mark for Review
(1) Points
True
False
22. There is only one kind of software used by all computers. True or Fale?
Mark for Review
(1) Points
True
False
Section 17 Lesson 1 (Answer all questions in this section)
The Concatenation Operator does which of the following?
(1) Points
Links rows of data together inside the database.
23.
_
%
#
&
25. 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
26. You need to display employees whose salary is in the range of 30000 and
50000. Which comparison operator should you use?
(1) Points
IN
LIKE
BETWEEN...AND...
IS NULL
27. Which clause would you include in a SELECT statement to restrict the data
returned to only the employees in department 10?
(1) Points
WHERE
FROM
SELECT
IS
28. 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 should you use?
(1) Points
+
|
||
AND
Section 17 Lesson 2 (Answer all questions in this section)
What will the result of the following SELECT statement be:
SELECT last_name, salary, salary + 300
FROM employees;
Mark for Review
(1) Points
Display the last name, salary and the results of adding 300 to each salary for all the
employees
29.
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 the new salary.
Display the last name, salary and the results of adding 300 to the salary of the first employee
row
30. The PLAYERS table contains these columns:
PLAYER_ID NUMBER (9) Primary Key
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;
Section 17 Lesson 2(Answer all questions in this section)
31. 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?
Review
(1) Points
AND
IN
BETWEEN
LIKE
32. Evaluate this SELECT statement:
SELECT *
FROM employees
Mark for
Mark for
!=
IN
BETWEEN..AND..
Section 17 Lesson 3 (Answer all questions in this section)
34. You want
to create a report that displays all employees who were hired before January 1, 2000 and whose
annual salaries are greater than 50000.
The EMPLOYEES table contains these columns:
EMPLOYEE_ID VARCHAR2(5) PRIMARY KEY
LAST_NAME VARCHAR2(35)
HIRE_DATE DATE
DEPARTMENT_ID NUMBER(4)
The SALARY table contains these columns:
SALARY_ID VARCHAR2(5) PRIMARY KEY
SALARY NUMBER(5, 2)
EMPLOYEE_ID VARCHAR2(5) FOREIGN KEY
False
36. The PRODUCT table contains these columns:
PRODUCT_ID NUMBER(9)
DESCRIPTION VARCHAR2(20)
COST NUMBER(5,2)
LOCATION_ID VARCHAR2(10)
You want to display product costs with these desired results:
1. The cost displayed for each product is increased by 10 percent.
2. The product location id must be 4859, 9789, or 9898.
3. Ten percent of the original cost is less than $10.
Which statement should you issue?
Mark for Review
(1) Points
SELECT product_id, cost * 1.10
FROM product
WHERE cost * .10 < 10.00
AND location_id IN (4859, 9789, 9898);
SELECT product_id, cost * .10
FROM product
WHERE cost * 1.10 > 10.00
AND location_id IN (4859, 9789, 9898);
SELECT product_id, cost * 1.10
FROM product
WHERE cost * 1.10 < 10.00
AND location_id = (4859, 9789, 9898);
SELECT product_id, cost * 1.10
FROM product
WHERE cost * .10 > 10.00
AND location_id = (4859, 9789, 9898);
Section 18 Lesson 1 (Answer all questions in this section)
comparison condition means "Less Than or Equal To?"
(1) Points
"=)"
37. Which
"+<"
">="
"<="
38. You need to replace null values in the DEPARTMENT_ID column with a zero (0).
Which function should you use?
(1) Points
NVL
NULL
NULLIF
REPLACE
39. Which clause would you include in a SELECT statement to sort the rows returned
by the LAST_NAME column?
(1) Points
ORDER BY
WHERE
FROM
HAVING
40. Which of the following are TRUE regarding the logical AND operator?
for Review
(1) Points
TRUE AND TRUE return FALSE
Mark
43. Evaluate
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?
Mark for Review
(1) Points
IN
AND
LIKE
BETWEEN ... AND ...
48. 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 condition will be evaluated before the AND condition.
The AND condition will be evaluated before the OR condition.
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
Section 18 Lesson 3 (Answer all questions in this section)
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?
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;
50. 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 tables aliases in the WHERE clause.
Remove the table aliases in the ORDER BY clause.