miercuri, 24 februarie 2010

Quiz: Self Joins and Hierarchical Queries

Test: Quiz: Self Joins and Hierarchical Queries
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 1

1. Hierarchical queries MUST use the LEVEL pseudo column. True or False? Mark for Review
(1) Points


True


False (*)


2. Which select statement will return the last name and hire data of an employee and his/ her manager for employees that started in the company before their managers? Mark for Review
(1) Points


SELECT w.last_name, w.hire_date, m.last_name, m.hire_date
FROM employees w , employees m
WHERE w.manager_id = m.employee_id AND w.hire_date < m.hire_date (*) SELECT w.last_name, w.hire_date, m.last_name, m.hire_date FROM employees w , employees m WHERE w.manager_id != m.employee_id AND w.hire_date < m.hire_date SELECT w.last_name, w.hire_date, m.last_name, m.hire_date FROM employees w , employees w WHERE w.manager_id = w.employee_id AND w.hire_date < w.hire_date SELECT w.last_name, w.hire_date, m.last_name, m.hire_date FROM employees w , employees m WHERE w.manager_id = m.employee_id AND w.hire_date > m.hire_date




Correct Correct


3. Which of the following database design concepts is implemented with a self join? Mark for Review
(1) Points


Non-Transferability


Recursive Relationship (*)


Supertype


Arc



Correct Correct


4. Hierarchical queries can walk both Top-Down and Bottom-Up. True or False? Mark for Review
(1) Points


True (*)


False


5. Which of the following database design concepts do you need in your tables to write Hierarchical queries? Mark for Review
(1) Points


Non-Transferability


Recursive Relationship (*)


Supertype


Arc


6. Which SELECT statement implements a self join? Mark for Review
(1) Points


SELECT e.employee_id, m.manager_id
FROM employees e NATURAL JOIN employees m;



SELECT e.employee_id, m.manager_id
FROM employees e, employees m
WHERE m.employee_id = e.manager_id;

(*)


SELECT e.employee_id, m.manager_id
FROM employees e, manager m
WHERE e.employee_id = m.manager_id;



SELECT e.employee_id, m.manager_id
FROM employees e, departments m
WHERE e.employee_id = m.manager_id;




Correct Correct

http://www.materie.ro/materie/quiz-self-joins-and-hierarchical-queries-50

Niciun comentariu:

Trimiteţi un comentariu