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; |
|
2. | A type of query that has either too few or no join conditions is known as a query. |
|
3. | Name three kinds of equijoins. |
|
4. | A natural join makes what assumption between the columns of two or more tables to be joined? |
|
5. | The Oracle9i syntax moves the join conditions from the clause to the clause in a SELECT statement. |
|
6. | To avoid a Cartesian product, a query with four tables must have at least how many join conditions between tables? |
|
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? |
|
8. | What is the symbol 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? |
|
10. | A primary key in one table would frequently be joined to what 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. |