【Oracle 12c】CUUG OCP认证071考试原题解析(30)

前端之家收集整理的这篇文章主要介绍了【Oracle 12c】CUUG OCP认证071考试原题解析(30)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
30.choose the best answer

Examine the commands used to create DEPARTMENT_DETAILS and COURSE_DETAILS:

sql> CREATE TABLE DEPARTMENT_DETAILS

(DEPARTMENT_ID NUMBER PRIMARY KEY,

DEPARTMENT_NAME VARCHAR2(50),

HOD VARCHAR2(50));

sql> CREATE TABLE COURSE_DETAILS

(COURSE_ID NUMBER PRIMARY KEY,

COURSE_NAME VARCHAR2 (50),

DEPARTMENT_ID NUMBER REFERENCES DEPARTMENT_DETAILS(DEPARTMENT_ID));

You want to generate a list of all department IDs that do not exist in the

COURSE_DETAILS table.

You execute the sql statement:

sql> SELECT d.department_id FROM course_details c INNER JOIN department_details d

ON c.department_id<>d.department_id;

What is the outcome?

A) It fails because the ON clause condition is not valid.

B) It executes successfully and displays the required list.

C) It executes successfully but displays an incorrect list.

D) It fails because the join type used is incorrect.

Answer:C

(如果条件中用<>,得从来的结果就是笛卡尔积,inner join 并不以谁为基础,它只显示

合条件的记录

联合连接(UNION JOIN):这是一种很少见的连接方式。Oracle、MysqL不支持,其作用

是:找出全外连接和内连接之间差异的所有行。这在数据分析中排错中比较常用。也可以利

数据库的集合操作来实现此功能

ORACLE 中可以用 minus 等同联合连接的功能

select deptno from dept

minus

select deptno from emp;

)

猜你在找的Oracle相关文章