Chapter 5


1.

Add a clause to the WHERE condition to make the following query return only the department names without employees:

select employee_id "Emp ID", last_name || ‘, ‘ ||   first_name "Name", department_name "Dept" from employees e,departments d where e.department_id(+) = d.department_id;

the following clause added to the where condition makes the query return only department names without employees: and employee_id is null

2.

A type of query that has either too few or no join conditions is known as a query.

cartesian product

3.

Name three kinds of equijoins.

inner joins, self-joins, left outer joins, right outer joins, and full outer joins are all examples of equijoins.

4.

A natural join makes what assumption between the columns of two or more tables to be joined?

a natural join assumes that the tables are to be joined on the columns that have the same names and datatypes.

5.

The Oracle9i syntax moves the join conditions from the clause to the clause in a SELECT statement.

 where , from

6.

To avoid a Cartesian product, a query with four tables must have at least how many join conditions between tables?

a query with four tables must have at least three join conditions to avoid a cartesian product.

7.

To return all the rows in one table regardless of whether any rows in another table match on the join condition, you would use what kind of a join?

an outer join returns all rows in one table regardless of whether any rows in another table match on the join condition.

8.

What is the symbol used to signify an outer join in a pre-Oracle9i query?

a (+) is used to signify an outer join in a pre-oracle9i query.

9.

A full outer join uses what SQL set operator in a pre-Oracle9i database query?

a full outer join uses the union set operator in a pre-oracle9i query.

10.

A primary key in one table would frequently be joined to what in a second table?

a primary key in one table would frequently be joined to a foreign key in a second table.

Answers

1.

The following clause added to the WHERE condition makes the query return only department names without employees:

and employee_id is null

2.

Cartesian product

3.

Inner joins, self-joins, left outer joins, right outer joins, and full outer joins are all examples of equijoins.

4.

A natural join assumes that the tables are to be joined on the columns that have the same names and datatypes.

5.

WHERE, FROM

6.

A query with four tables must have at least three join conditions to avoid a Cartesian product.

7.

An outer join returns all rows in one table regardless of whether any rows in another table match on the join condition.

8.

A (+) is used to signify an outer join in a pre-Oracle9i query.

9.

A full outer join uses the UNION set operator in a pre-Oracle9i query.

10.

A primary key in one table would frequently be joined to a foreign key in a second table.




Oracle9i DBA JumpStart
Oracle9i DBA JumpStart
ISBN: 0782141897
EAN: 2147483647
Year: 2006
Pages: 138
Authors: Bob Bryla

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net