Free 1Z0-047 Questions for Oracle Database SQL Expert 1Z0-047 Exam as PDF & Practice Test Engine
View the Exhibit and examine the structure of the CUST table.
Evaluate the following SQL statements executed in the given order:
ALTER TABLE cust
ADD CONSTRAINT cust_id_pk PRIMARY KEY(cust_id) DEFERRABLE INITIALLY DEFERRED;
INSERT INTO cust VALUES (1 /RAJ1); --row 1
INSERT INTO cust VALUES (1 ,'SAM); --row 2
COMMIT;
SET CONSTRAINT cust_id_pk IMMEDIATE;
INSERT INTO cust VALUES (1 /LATA1); --row 3
INSERT INTO cust VALUES (2 .KING1); --row 4
COMMIT;
Which rows would be made permanent in the CUST table?

Evaluate the following SQL statements executed in the given order:
ALTER TABLE cust
ADD CONSTRAINT cust_id_pk PRIMARY KEY(cust_id) DEFERRABLE INITIALLY DEFERRED;
INSERT INTO cust VALUES (1 /RAJ1); --row 1
INSERT INTO cust VALUES (1 ,'SAM); --row 2
COMMIT;
SET CONSTRAINT cust_id_pk IMMEDIATE;
INSERT INTO cust VALUES (1 /LATA1); --row 3
INSERT INTO cust VALUES (2 .KING1); --row 4
COMMIT;
Which rows would be made permanent in the CUST table?

Correct Answer: D
Vote an answer
Which statements are correct regarding indexes? (Choose all that apply.)
Correct Answer: B,C,D
Vote an answer
View the Exhibit and examine the description of the EMPLOYEES table.
You executed the following SQL statement:
SELECT first_name, department_id, salary
FROM employees
ORDER BY department_id, first_name, salary desc;
Which two statements are true regarding the output of the above query? (Choose two.)

You executed the following SQL statement:
SELECT first_name, department_id, salary
FROM employees
ORDER BY department_id, first_name, salary desc;
Which two statements are true regarding the output of the above query? (Choose two.)

Correct Answer: B
Vote an answer
Explanation: Only visible for ExamDiscuss members. You can sign-up / login (it's free).
Evaluate the following SQL statement:
SELECT 2 col1,ycol2 FROM dual UNION SELECT 1 ,'x' FROM dual
UNION SELECT 3 .NULL FROM dual ORDER BY 2;
Which statement is true regarding the output of the SQL statement?
SELECT 2 col1,ycol2 FROM dual UNION SELECT 1 ,'x' FROM dual
UNION SELECT 3 .NULL FROM dual ORDER BY 2;
Which statement is true regarding the output of the SQL statement?
Correct Answer: A
Vote an answer
View the Exhibit and examine the structure of EMPLOYEES and JOB_IHISTORY tables.
The EMPLOYEES table maintains the most recent information regarding salary, department, and job for all the employees. The JOB_HISTORY table maintains the record for all the job changes for the employees. You want to delete all the records from the JOB_HISTORY table that are repeated in the EMPLOYEES table.
Which two SQL statements can you execute to accomplish the task? (Choose two.)

A DELETE FROM job_history j WHERE employee_id = (SELECT employee_id FROM employees e WHERE j.employee_id = e.employee_id) AND job _id = (SELECT job _id FROM employees e WHERE j.job_id = e.job_id);
B. DELETE FROM job_history j WHERE (employee_id, job _id) = ALL (SELECT employee_id, job_id FROM employees e WHERE j.employee_id = e.employee_id and j.job_id = e.job_id)
C. DELETE FROM job_history j WHERE employee_id = (SELECT employee_id FROM employees e WHERE j.employee_id = e.employee_id and j.job_id = e.job_id)
D. DELETE FROM job_history j WHERE (employee_id, job _id) = (SELECT employee_id, job_id FROM employees e WHERE j.employee_id = e.employee_id and j.job_id = e.job_id)
The EMPLOYEES table maintains the most recent information regarding salary, department, and job for all the employees. The JOB_HISTORY table maintains the record for all the job changes for the employees. You want to delete all the records from the JOB_HISTORY table that are repeated in the EMPLOYEES table.
Which two SQL statements can you execute to accomplish the task? (Choose two.)

A DELETE FROM job_history j WHERE employee_id = (SELECT employee_id FROM employees e WHERE j.employee_id = e.employee_id) AND job _id = (SELECT job _id FROM employees e WHERE j.job_id = e.job_id);
B. DELETE FROM job_history j WHERE (employee_id, job _id) = ALL (SELECT employee_id, job_id FROM employees e WHERE j.employee_id = e.employee_id and j.job_id = e.job_id)
C. DELETE FROM job_history j WHERE employee_id = (SELECT employee_id FROM employees e WHERE j.employee_id = e.employee_id and j.job_id = e.job_id)
D. DELETE FROM job_history j WHERE (employee_id, job _id) = (SELECT employee_id, job_id FROM employees e WHERE j.employee_id = e.employee_id and j.job_id = e.job_id)
Correct Answer:
CD
Which two statements are true regarding operators used with subqueries? (Choose two.
Correct Answer: A,D
Vote an answer
View the Exhibit and examine the structure of the EMP table which is not partitioned and not an
index-organized table.
Evaluate the following SQL statement:
ALTER TABLE emp DROP COLUMN first_name;
Which two statements are true regarding the above command? (Choose two.)

index-organized table.
Evaluate the following SQL statement:
ALTER TABLE emp DROP COLUMN first_name;
Which two statements are true regarding the above command? (Choose two.)

Correct Answer: B,D
Vote an answer
Which two statements are true regarding the GROUP BY clause in a SQL statement? (Choose two.)
Correct Answer: C,E
Vote an answer
Evaluate the following ALTER TABLE statement:
ALTER TABLE orders SET UNUSED order_date;
Which statement is true?
ALTER TABLE orders SET UNUSED order_date;
Which statement is true?
Correct Answer: D
Vote an answer
View the Exhibit and examine the details of the EMPLOYEES table.
You want to generate a hierarchical report for all the employees who report to the employee
whose EMPLOYEE_ID is 100.
Which SQL clauses would you require to accomplish the task? (Choose all that apply.)

You want to generate a hierarchical report for all the employees who report to the employee
whose EMPLOYEE_ID is 100.
Which SQL clauses would you require to accomplish the task? (Choose all that apply.)

Correct Answer: A,B,D
Vote an answer
You need to create a table with the following column specifications:
1.Employee ID (numeric data type) for each employee
2.Employee Name, (character data type) which stores the employee name
3.Hire date, to store the date when the employee joined the organization
4.Status (character data type). It should contain the value if no data is entered.
5.Resume (character large object [CLOB] data type), which would contain the resume submitted by the employee
Which is the correct syntax to create this table?
1.Employee ID (numeric data type) for each employee
2.Employee Name, (character data type) which stores the employee name
3.Hire date, to store the date when the employee joined the organization
4.Status (character data type). It should contain the value if no data is entered.
5.Resume (character large object [CLOB] data type), which would contain the resume submitted by the employee
Which is the correct syntax to create this table?
Correct Answer: C
Vote an answer
View the Exhibit and examine the description of the ORDERS table.
Evaluate the following SQL statement:
SELECT order_id, customer_id FROM orders WHERE order_date > 'June 30 2001';
Which statement is true regarding the execution of this SQL statement?

Evaluate the following SQL statement:
SELECT order_id, customer_id FROM orders WHERE order_date > 'June 30 2001';
Which statement is true regarding the execution of this SQL statement?

Correct Answer: C
Vote an answer
View the Exhibit and examine the description of the EMPLOYEES and DEPARTMENTS tables.
You want to display the LAST_NAME for the employees, LAST_NAME for the manager of the
employees, and the DEPARTMENT_NAME for the employees having 100 as MANAGER_ID.
The following SQL statement was written:
SELECT m.last_name "Manager", e.last_name "Employee", department_name "Department"
FROM employees m JOIN employees e
ON (m.employee_id = e.manager_id)
WHERE e.manager_id=100
JOIN departments d
ON (e.department_id = d.department_id);
Which statement is true regarding the output of this SQL statement?

You want to display the LAST_NAME for the employees, LAST_NAME for the manager of the
employees, and the DEPARTMENT_NAME for the employees having 100 as MANAGER_ID.
The following SQL statement was written:
SELECT m.last_name "Manager", e.last_name "Employee", department_name "Department"
FROM employees m JOIN employees e
ON (m.employee_id = e.manager_id)
WHERE e.manager_id=100
JOIN departments d
ON (e.department_id = d.department_id);
Which statement is true regarding the output of this SQL statement?

Correct Answer: C
Vote an answer
0
0
0
10
