luni, 6 decembrie 2010

finalu profei

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

Entity integrity

User-defined integrity (*)

Column integrity

Referential integrity

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

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


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

True

False (*)


Section 12 Lesson 2
(Answer all questions in this section)

5. The transformation from an ER diagram to a physical design involves changing terminology. Primary Unique Identifiers in the ER diagram become __________ and relationships become ____________. Mark for Review
(1) Points

Foreign keys, primary keys

Primary keys, Foreign keys (*)

Foreign keys, mandatory business rules

Unique Keys, Primary keys


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

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


Section 12 Lesson 3
(Answer all questions in this section)

8. One-to-One relationships are transformed into Check Constraints in the tables created at either end of that relationship. True or False? Mark for Review
(1) Points

True

False (*)


Incorrect. Refer to Section 12


9. It is possible to implement non-transferability via a simple Foreign Key Relationship. True or False? Mark for Review
(1) Points

True

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

True

False (*)

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 access are all very different between subtypes. (*)

Most of the relationships are at the supertype level



Section 13 Lesson 1
(Answer all questions in this section)

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

True

False (*)


13. What command will return data from the database to you? Mark for Review
(1) Points

FETCH

GET

SELECT (*)

RETURN



Section 16 Lesson 1
(Answer all questions in this section)

14. If a SQL statement returns data from two or more tables, which SQL capability is being used? Mark for Review
(1) Points

Selection

Projection

Joining (*)

Insertion


15. You query the database with this SQL statement:
SELECT * FROM students;
Why would you use this statement?
Mark for Review
(1) Points

To insert data

To view data (*)

To display the table structure

To delete data

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


17. The EMPLOYEES table contains these columns:
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:

Salary = 500, Bonus = 50, Commission_pct = .5

Evaluate these two SQL statements:

1.
SELECT salary + bonus + commission_pct * salary - bonus AS income
FROM employees;

2.
SELECT (salary + bonus ) + commission_pct * (salary - bonus) income
FROM employees;

What will be the result?
Mark for Review
(1) Points

Statement 1 will return a higher value than statement 2. (*)

Statement 2 will return a higher value than statement 1.

Statement 1 will display a different column heading.

One of the statements will NOT execute.


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

19. In the default order of precedence, which operator would be evaluated first? Mark for Review
(1) Points

Subtractions

Multiplications (*)

Additions

Divisions


20. Which keyword can be used to specify a column alias? Mark for Review
(1) Points

AS (*)

DESCRIBE

FROM

WHERE

21. In a SELECT statement Additions are evaluated before Multiplications. True or False? Mark for Review
(1) Points

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

True

False (*)


Section 17 Lesson 1
(Answer all questions in this section)

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


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


25. Which comparison operator searches for a specified character pattern? Mark for Review
(1) Points

IN

LIKE (*)

BETWEEN...AND...

IS NULL

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

+

|

|| (*)

AND


27. You need to display employees with salaries that are at least 30000 or higher. Which comparison operator should you use? Mark for Review
(1) Points

>

"=>"

>= (*)

!=


28. When using the LIKE condition, which symbol represents any sequence of none, one or more characters? Mark for Review
(1) Points

_

% (*)

#

&


Section 17 Lesson 2
(Answer all questions in this section)

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

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

% (*)

~

#

*


31. You need write a SELECT statement that should only return rows that contain 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 values? Mark for Review
(1) Points

=

!=

IN (*)

BETWEEN..AND..


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

33. You want to determine the orders that have been placed by customers who live 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;


Section 17 Lesson 3
(Answer all questions in this section)

34. The EMPLOYEES table contains these columns:
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
EMAIL VARCHAR2(50)

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

WHERE email = NULL;

WHERE email != NULL;

WHERE email IS NULL;

WHERE email IS NOT NULL; (*)

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

Which query should you issue?
Mark for Review
(1) Points

SELECT last_name, hiredate, salary
FROM employees NATURAL JOIN salary USING employee_id
WHERE hiredate < 01-jan-00 AND salary > 50000;


SELECT last_name, hiredate, salary
FROM employees JOIN salary
ON employee_id = employee_id
WHERE hiredate < '01-jan-00' AND salary > 50000;


SELECT last_name, hiredate, salary
FROM employees NATURAL JOIN salary
WHERE hiredate < '01-jan-00' AND salary > 50000;
(*)


SELECT last_name, hiredate, salary
FROM employees (+) salary
WHERE hiredate < '01-jan-00' AND salary > 50000;


36. The STUDENT table contains these columns:
STUDENT_ID NUMBER(10) Primary Key
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
MAIN_SUBJECT_ID NUMBER(3)
ADVISOR_ID NUMBER(5)

Evaluate this statement:
SELECT DISTINCT advisor_id, main_subject_id
FROM student;

Which statement is true?
Mark for Review
(1) Points

Each ADVISOR_ID can be displayed only once.

Each MAIN_SUBJECT_ID can be displayed more than once per ADVISOR_ID. (*)

Each combination of ADVISOR_ID and MAIN_SUBJECT_ID can be displayed more than once.

Each MAIN_SUBJECT_ID can be displayed only once.


Section 18 Lesson 1
(Answer all questions in this section)

37. 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 include in the ORDER BY clause? Mark for Review
(1) Points

DESC (*)

ASC

SORT

CHANGE


38. Which logical operator returns TRUE if either condition is true? Mark for Review
(1) Points

OR (*)

AND

NOT

BOTH


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


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

41. The ORDER BY clause always comes last. True or False? Mark for Review
(1) Points

True (*)

False

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 statement


Section 18 Lesson 2
(Answer all questions in this section)

43. 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 values.

The rows will be sorted alphabetically by the FIRST_NAME and then the LAST_NAME values


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

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

46. Which SELECT statement should you use to limit the display of product information 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; (*)

SELECT product_id, product_name FROM products HAVING price < 50;

SELECT product_id, product_name FROM products WHERE price <= 50;

SELECT product_id, product_name FROM products GROUP BY price < 50;

SELECT product_id, product_name FROM products WHERE price < 50.00 GROUP BY price;


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


48. Evaluate this SELECT statement:
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 ...


Section 18 Lesson 3
(Answer all questions in this section)

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

Include a HAVING clause.


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

Niciun comentariu:

Trimiteți un comentariu