READ Free Dumps For Oracle- 1z0-007
Question ID 7852 | You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?
|
Option A | ALTER TABLE students ADD PRIMARY KEY student_id;
|
Option B | ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student _ id);
|
Option C | ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student _ id);
|
Option D | ALTER TABLE students ADD CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
|
Option E | ALTER TABLE students MODIFY CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
|
Correct Answer | D |
Explanation Explanation/Reference: Explanation: This statement provides correct syntax to add a primary key on the STUDENT_ID column of the STUDENT table. Incorrect Answers A: This ALTER TABLE statement is missing CONSTRAINT keyword and the name of the constraint. B: This ALTER TABLE statement is missing the name of the constraint. C: It's incorrect syntax in the ALTER TABLE command: STUDENT_ID must be used with brackets. E: We need to add constraint, not to modify existing one. Usage of the MODIFY keyword is incorrect in this case. OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 239-240 Chapter 5: Creating Oracle Database Objects
Question ID 7853 | Evaluate the SQL statement: 1 SELECT a.emp_name, a.sal, a.dept_id, b.maxsal 2 FROM employees a, 3 (SELECT dept_id, MAX(sal) maxsal 4. FROM employees 5 GROUP BY dept_id) b 6 WHERE a.dept_id = b.dept_id 7 AND a. asl < b. maxsal; What is the result of the statement?
|
Option A | The statement produces an error at line 1.
|
Option B | The statement produces an error at line 3.
|
Option C | . The statement produces an error at line 6.
|
Option D | The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all departments that pay less salary then the maximum salary paid in the company.
|
Option E | The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all employees who earn less than the maximum salary in their department.
|
Correct Answer | E |
Explanation Explanation/Reference: Explanation: The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all employees who earn less than the maximum salary in their department. This query is example of an inline view which is the sub-query in the FROM clause of the main query. The sub-query can be a SELECT statement that utilizes joins, the GROUP BY clause, or the ORDER BY clause. Incorrect Answers A: The statement does not produce an error at line 1. B: The statement does not produce an error at line 3. C: The statement does not produce an error at line 6. D: The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all EMPLOYEES, NOT DEPARTMENTS, who earn less than the maximum salary in their department. OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 161-165 Chapter 4: Subqueries