📄 que_164.htm
字号:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>Ocp test </title>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<p align="left" color="black" style="font-size:16pt;">
<b>QUESTION 164
</b></p><hr color="#99CCFF">
<p>Examine the structure of the EMPLOYEES table:</p><table border="1" bordercolor="gray">
<tr>
<td align="left" width="486" bgcolor="#99CCFF">
<p><b>EMPLOYEES table: </b></p>
</td>
</tr>
<tr>
<td align="left" bgcolor="white">
<p><b>EMPLOYEE_ID NUMBER NOT NULL </b></p>
</td>
</tr>
<tr>
<td align="left" bgcolor="white">
<p><b>EMP_NAME VARCHAR2(30) </b></p>
</td>
</tr>
<tr>
<td align="left" bgcolor="white">
<p><b>JOB_ID VARCHAR2(20) </b></p>
</td>
</tr>
<tr>
<td align="left" bgcolor="white">
<p><b>SAL NUMBER </b></p>
</td>
</tr>
<tr>
<td align="left" bgcolor="white">
<p><b>MGR_ID NUMBER </b></p>
</td>
</tr>
<tr>
<td align="left" bgcolor="white">
<p><b>DEPARTMENT_ID NUMBER </b></p>
</td>
</tr>
</table>
<p>You want to create a SQL script file that contains an INSERT statement. When the
script is run, the INSERT statement should insert a row with the specified values into
the EMPLOYEES table. The INSERT statement should pass values to the table columns
as specified below: <br>
<br>EMPLOYEE_ID: Next value from the sequence
EMP_ID_SEQEMP_NAME <br>JOB_ID: As specified by the user during run time, through
substitution variables
<br>SAL: 2000
<br>MGR_ID: No value
<br>DEPARTMENT_ID: Supplied by the user during run time through substitution variable. <br><br>The
INSERT statement should fail if the user supplies a value other than 20 or 50.
<br>Which INSERT statement meets the above requirements? </p><table border="1" bordercolor="gray" width="665">
<form name="youAnsForm">
<span style="font-size:18pt;">
<tr>
<td align="center" width="89">
<p><b><input type="radio" name="AN" value="A"> A.</b></p>
</td>
<td align="left" width="566">
<p> INSERT INTO employees<br>VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000,
NULL, &did);
</p>
</td>
</tr>
<tr>
<td align="center" width="89">
<p><b><input type="radio" name="AN" value="B"> B.</b></p>
</td>
<td align="left" width="566">
<p> INSERT INTO employees<br>VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000,
NULL, &did IN (20,50));
</p>
</td>
</tr>
<tr>
<td align="center" width="89">
<p><b><input type="radio" name="AN" value="C"> C.</b></p>
</td>
<td align="left" width="566">
<p> INSERT INTO (SELECT * FROM employees <br> WHERE department_id IN (20,50)) <br>
VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
</p>
</td>
</tr>
<tr>
<td align="center" width="89">
<p><b><input type="radio" name="AN" value="D"> D.</b></p>
</td>
<td align="left" width="566">
<p> INSERT INTO (SELECT * FROM employees <br> WHERE department_id IN (20,50) <br>
WITH
CHECK OPTION)<br>VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000,
NULL,
&did);
</p>
</td>
</tr>
<tr>
<td align="center" width="89">
<p><b><input type="radio" name="AN" value="E"> E.</b></p>
</td>
<td align="left" width="566">
<p> INSERT INTO (SELECT * FROM employees <br> WHERE (department_id = 20 AND <br>
department_id = 50) WITH CHECK OPTION )<br>VALUES (emp_id_seq.NEXTVAL,
'&ename', '&jobid', 2000, NULL, &did);</p>
</td>
</tr>
</span>
</form>
</table>
<p> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -