1z0-047 Premium Bundle

1z0-047 Premium Bundle

Oracle Database SQL Expert Certification Exam

4.5 
(11295 ratings)
0 QuestionsPractice Tests
0 PDFPrint version
May 20, 2024Last update

Oracle 1z0-047 Free Practice Questions

Q1. View the Exhibit and examine the structure of the ORDERS table. Which task would require subqueries? 

A. displaying the total order value for sales representatives 161 and 163 

B. displaying the order total for sales representative 161 in the year 1999 

C. displaying the number of orders that have order mode online and order date in 1999 

D. displaying the number of orders whose order total is more than the average order total for all online orders 

Answer: D

Q2. Which statement best describes the GROUPING function? 

A. It is used to set the order for the groups to be used for calculating the grand totals and subtotals. 

B. It is used to form various groups to calculate total and subtotals created using ROLLUP and CUBE operators. 

C. It is used to identify if the NULL value in an expression is a stored NULL value or created by ROLLUP or CUBE. 

D. It is used to specify the concatenated group expressions to be used for calculating the grand totals and subtotals. 

Answer:

Q3. View the Exhibit and examine the structure of ORD and ORD_ITEMS tables. 

In the ORD table, the PRIMARY KEY is ORD_NO and in the ORD_ITEMS tables the composite PRIMARY KEY is (ORD_NO, ITEM_NO). 

Which two CREATE INDEX statements are valid? (Choose two.) 

A. CREATE INDEX ord_idx 

ON ord(ord_no); 

B. CREATE INDEX ord_idx 

ON ord_items(ord_no); 

C. CREATE INDEX ord_idx 

ON ord_items(item_no); 

D. CREATEINDEX ord_idx 

ON ord,ord_items(ord_no, ord_date,qty); 

Answer: BC

Q4. The user SCOTT who is the owner of ORDERS and ORDERJTEMS tables issues the following GRANT command: 

GRANT ALL ON orders, order_items TO PUBLIC; 

What correction needs to be done to the above statement? 

A. PUBLICshould bereplacedwithspecific usernames. 

B. ALL should be replaced with a list of specific privileges. 

C. WITH GRANTOPTIONshould beaddedto the statement. 

D. Separate GRANT statements are required for ORDERSandORDERJTEMS tables. 

Answer: D

Q5. View the Exhibit and examine the description of the EMPLOYEES table. 

You want to calculate the total remuneration for each employee. Total remuneration is the sum of the annual salary and the percentage commission earned for a year. Only a few employees earn commission. 

Which SOL statement would you execute to get the desired output? 

A. SELECTfirst_name, salary, salary*12+salary*commission_pct "Total" 

FROM EMPLOYEES; 

B. SELECTfirst_name,salary, salary*12+NVL((salary*commission_pct), 0) "Total" 

FROMEMPLOYEES; 

C. SELECTfirst_name, salary, salary*12 + NVL(salary, O)*commission_pct "Total" 

FROM EMPLOYEES; 

D. SELECTfirst_name, salary, salary*12+(salary*NVL2(commission_pct, 

salary,salary+commission_pct))"Total" 

FROM EMPLOYEES; 

Answer: B

Q6. You need to load information about new customers from the NEW_CUST table into the tables CUST and CUST_SPECIAL If a new customer has a credit limit greater than 10,000, then the details have to be inserted into CUST_SPECIAL All new customer details have to be inserted into the CUST table. Which technique should be used to load the data most efficiently? 

A. external table 

B. the MERGE command 

C. the multi table INSERT command 

D. INSERT using WITHCHECK OPTION 

Answer: C

Q7. View the Exhibit and examine the data in the PRODUCT INFORMATION table. 

Which two tasks would require subqueries? (Choose two.) 

A. displaying the minimum list price for each product status 

B. displaying all supplier IDs whose average list price is more than 500 

C. displaying the number of products whose list prices are more than the average list price 

D. displaying all the products whose minimum list prices are more than the average list price of products having the product status orderable 

E. displaying the total number of products supplied by supplier 102071 and having product status OBSOLETE 

Answer: CD

Q8. Which mandatory clause has to be added to the following statement to successfully create an external table called EMPDET? 

CREATE TABLE empdet 

(empno CHAR(2), ename CHAR(5), deptno NUMBER(4)) 

ORGANIZATION EXTERNAL 

(LOCATION ('emp.daf)); 

A. TYPE 

B. REJECTLIMIT 

C. DEFAULT DIRECTORY 

D. ACCESS PARAMETERS 

Answer: C

Q9. Which CREATE TABLE statement is valid? 

A. CREATE TABLE ord_details 

(ord_no NUMBER(2) PRIMARY KEY, 

item_no NUMBER(3)PRIMARY KEY, 

ord_date date NOT NULL); 

B. CREATE TABLE ord_details 

(ord_no NUMBER(2) UNIQUE, NOT NULL, 

item_no NUMBER(3), 

ord_date date DEFAULT SYSDATE NOT NULL); 

C. CREATE TABLE ord_details 

(ord_no NUMBER(2) , 

item_no NUMBER(3), 

ord_date date DEFAULT NOT NULL, 

CONSTRAINT ord_uq UNIQUE (ord_no), 

CONSTRAINT ord_pk PRIMARY KEY (ord_no)); 

D. CREATE TABLE ord_details 

(ord_no NUMBER(2), 

item_no NUMBER(3), 

ord_date date DEFAULT SYSDATE NOT NULL, 

CONSTRAINT ord_pk PRIMARY KEY (ord_no, item_no)); 

Answer: D

Q10. Which two statements are true regarding subqueries? (Choose three.) 

A. The ORDER BY clause can be used in the subquery. 

B. A subquery can be used in the FROM clause of a SELECT statement. 

C. If the subquery returns NULL, the main query may still return result rows. 

D. A subquery can be placed in a WHERE clause, GROUP BY clause, or a HAVING clause. 

E. Logical operators, such as AND, OR and NOT, cannot be used in the WHERE clause of a subquery. 

Answer: ABC

Q11. Evaluate the following command: 

CREATE TABLE employees (employee_id NUMBER(2) PRIMARY KEY, last_name VARCHAR2(25) NOT NULL, department_id NUMBER(2), job_id VARCHAR2(8), salary NUMBER(10,2)); 

You issue the following command to create a view that displays the IDs and last names of the sales staff in the organization: 

CREATE OR REPLACE VIEW sales_staff_vu AS SELECT employee_id, last_name job_id FROM employees WHERE job_id LIKE 'SA_%' WITH CHECK OPTION; 

Which statements are true regarding the above view? (Choose all that apply.) 

A. It allows you to insert details of allnewstaff into the EMPLOYEES table. 

B. Itallowsyou todeletethedetails of the existing sales staff fromtheEMPLOYEES table. 

C. It allows you to updatethejob ids oftheexisting sales staff to any other job id in the EMPLOYEES table. 

D. It allows you to insert the IDs, last names and job ids of the sales staff from theviewif it is used in multitable INSERT statements. 

Answer: BD

Q12. Which two statements are true regarding roles? (Choose two.) 

A. A role can be granted to itself. 

B. A role can be granted to PUBLIC. 

C. A user can be granted only one role at any point of time. 

D. The REVOKE command can be used to remove privileges but not roles from other users. 

E. Roles are named groups of related privileges that can be granted to users or other roles. 

Answer: BE

Q13. View the Exhibit and examine the description of the ORDERS table. 

Which two WHERE clause conditions demonstrate the correct usage of conversion functions? (Choose two.) 

A. WHERE order_date > TO_DATE('JUL 10 2006','MON DD YYYY") 

B. WHERE TO_CHAR(order_date,'MON DD YYYY} = 'JAN 20 2003' 

C. WHERE order_date > T0_CHAR(ADD_M0NTHS(SYSDATE,6),'M0N DD YYYY’) 

D. WHERE order_date IN (T0_DATE('0ct 21 2003','Mon DD YYYY’), T0_CHAR('N0V 21 2003','Mon DD YYYY’)) 

Answer: AB

Q14. Which statement is true regarding external tables? 

A. The default REJECT LIMIT for external tables is UNLIMITED. 

B. The data and metadata for an external table are stored outside the database. 

C. ORACLE_LOADER and ORACLE_DATAPUMP have exactly the same functionality when used with an external table. 

D. The CREATE TABLE AS SELECT statement can be used to unload data into regular table in the database from an external table. 

Answer: D

Q15. View the Exhibit and examine the data in ORDERS_MASTER and MONTHLY_ORDERS tables. 

Evaluate the following MERGE statement: 

MERGE INTO orders_master o USING monthly_orders m ON (o.order_id = m.order_id) WHEN MATCHED THEN UPDATE SET o.order_total = m.order_total DELETE WHERE (m.order_total IS NULL) WHEN NOT MATCHED THEN INSERT VALUES (m.order_id, m.order_total); 

What would be the outcome of the above statement? 

A. The ORDERS_MASTER table would contain the ORDER_IDs 1 and 2. 

B. The ORDERS_MASTER table would contain the ORDER_IDs 1,2 and 3. 

C. The ORDERS_MASTER table would contain the ORDER_IDs 1,2 and 4. 

D. The ORDERS_MASTER table would contain the ORDER IDs 1,2,3 and 4. 

Answer: C

START 1z0-047 EXAM