Oracle 1Z0-071 ExamName: Oracle Database 12c SQL Questions & Answers Sample PDF (Preview content before you buy) Check the full version using the link below. https://pass2certify.com/exam/1z0-071 Unlock Full Features: Stay Updated: 90 days of free exam updates Zero Risk: 30-day money-back policy Instant Access: Download right after purchase Always Here: 24/7 customer support team Page 1 of 7 https://pass2certify.com//exam/1z0-071 Question 1. (Single Select) Choose the best answer. Examine the description of the EMPLOYEES table: Which query is valid? A: SELECT dept_id, join_date,SUM(salary) FROM employees GROUP BY dept_id, join_date; B: SELECT depe_id,join_date,SUM(salary) FROM employees GROUP BY dept_id: C: SELECT dept_id,MAX(AVG(salary)) FROM employees GROUP BY dept_id; D: SELECT dept_id,AVG(MAX(salary)) FROM employees GROUP BY dapt_id; Answer: A Explanation: In Oracle 12c SQL, the GROUP BY clause is used to arrange identical data into groups with the GROUP BY expression followed by the SELECT statement. The SUM() function is then used to calculate the sum for each grouped record on a specific column, which in this case is the salary column. Option A is valid because it correctly applies the GROUP BY clause. Both dept_id and join_date are included in the SELECT statement, which is a requirement when using these columns in conjunction with the GROUP BY clause. This means that the query will calculate the sum of salaries for each combination of dept_id and join_date. It adheres to the SQL rule that every item in the SELECT list must be either an aggregate function or appear in the GROUP BY clause. Option B is invalid due to a typo in SELECT depe_id and also because it ends with a colon rather than a semicolon. Option C is invalid because you cannot nest aggregate functions like MAX(AVG(salary)) without a subquery. Page 2 of 7 https://pass2certify.com//exam/1z0-071 Option D is invalid for the same reason as option C, where it tries to nest aggregate functions AVG(MAX(salary)), which is not allowed directly in SQL without a subquery. For further reference, you can consult the Oracle 12c documentation, which provides comprehensive guidelines on how to use the GROUP BY clause and aggregate functions like SUM(): Oracle Database SQL Language Reference, 12c Release 1 (12.1): GROUP BY Clause Oracle Database SQL Language Reference, 12c Release 1 (12.1): Aggregate Functions Question 2. (Multi Select) Which three are true about the CREATE TABLE command? A: It can include the CREATE...INDEX statement for creating an index to enforce the primary key constraint. B: The owner of the table should have space quota available on the tablespace where the table is defined. C: It implicitly executes a commit. D: It implicitly rolls back any pending transactions. E: A user must have the CREATE ANY TABLE privilege to create tables. F: The owner of the table must have the UNLIMITED TABLESPACE system privilege. Answer: B, C, E Explanation: A . False - The CREATE TABLE command cannot include a CREATE INDEX statement within it. Indexes to enforce constraints like primary keys are generally created automatically when the constraint is defined, or they must be created separately using the CREATE INDEX command. B . True - The owner of the table needs to have enough space quota on the tablespace where the table is going to be created, unless they have the UNLIMITED TABLESPACE privilege. This ensures that the database can allocate the necessary space for the table. Oracle Database SQL Language Reference, 12c Release 1 (12.1). C . True - The CREATE TABLE command implicitly commits the current transaction before it executes. This behavior ensures that table creation does not interfere with transactional consistency. Oracle Database SQL Language Reference, 12c Release 1 (12.1). D . False - It does not implicitly roll back any pending transactions; rather, it commits them. E . True - A user must have the CREATE ANY TABLE privilege to create tables in any schema other than their own. To create tables in their own schema, they need the CREATE TABLE privilege. Oracle Database Page 3 of 7 https://pass2certify.com//exam/1z0-071 Security Guide, 12c Release 1 (12.1). F . False - While the UNLIMITED TABLESPACE privilege allows storing data without quota restrictions on any tablespace, it is not a mandatory requirement for a table owner. Owners can create tables as long as they have sufficient quotas on the specific tablespaces. Question 3. (Multi Select) Which three are true about granting object privileges on tables, views, and sequences? A: UPDATE can be granted only on tables and views. B: DELETE can be granted on tables, views, and sequences. C: REFERENCES can be granted only on tables and views. D: INSERT can be granted on tables, views, and sequences. E: SELECT can be granted only on tables and views. F: ALTER can be granted only on tables and sequences. Answer: C, E, F Explanation: In Oracle Database, object privileges are rights to perform a particular action on a specific object in the database. Here's why the other options are incorrect: A . UPDATE can be granted on tables, views, and materialized views, but not sequences. B. DELETE cannot be granted on sequences because sequences do not store data that can be deleted. D. INSERT cannot be granted on sequences; sequences are used to generate numbers, not to be inserted into directly. C. REFERENCES allows the grantee to create a foreign key that references the table or the columns of the table. It is applicable only to tables and views. E. SELECT can indeed only be granted on tables and views (including materialized views). F. ALTER is an object privilege that can be granted on tables and sequences but not views. For more details, one may refer to the Oracle Database SQL Language Reference documentation, which specifies the types of object privileges and the objects they apply to. Question 4. (Single Select) The EMPLOYEES table contains columns EMP_ID of data type NUMBER and HIRE_DATE of data type Page 4 of 7 https://pass2certify.com//exam/1z0-071 DATE You want to display the date of the first Monday after the completion of six months since hiring. The NLS_TERRITORY parameter is set to AMERICA in the session and, therefore, Sunday is the first day of the week Which query can be used? A: SELECT emp_id,NEXT_DAY(ADD_MONTHS(hite_date,6),'MONDAY') FROM employees; B: SELECT emp_id,ADD_MONTHS(hire_date,6), NEXT_DAY('MONDAY') FROM employees; C: SELECT emp_id,NEXT_DAY(MONTHS_BETWEEN(hire_date,SYSDATE),6) FROM employees; D: SELECT emp_id,NEXT_DAY(ADD_MONTHS(hire_date,6),1) FROM employees; Answer: A Explanation: The function ADD_MONTHS(hire_date, 6) adds 6 months to the hire_date. The function NEXT_DAY(date, 'day_name') finds the date of the first specified day_name after the date given. In this case, 'MONDAY' is used to find the date of the first Monday after the hire_date plus 6 months. Option A is correct as it accurately composes both ADD_MONTHS and NEXT_DAY functions to fulfill the requirement. Options B, C, and D do not provide a valid use of the NEXT_DAY function, either because of incorrect syntax or incorrect logic in calculating the required date. The Oracle Database SQL Language Reference for 12c specifies how these date functions should be used. Question 5. (Multi Select) Which three statements are true about views in an Oracle database? A: A SELECT statement cannot contain a where clause when querying a view containing a WHERE clause in its defining query B: Rows inserted into a table using a view are retained in the table if the view is dropped C: Views can join tables only if they belong to the same schema. D: Views have no segment. E: Views have no object number. F: A view can be created that refers to a non-existent table in its defining query. Answer: B, D, F Page 5 of 7 https://pass2certify.com//exam/1z0-071 Explanation: A view is a virtual table based on a SQL query. A . This is incorrect because a SELECT statement querying a view can contain a WHERE clause, regardless of the view’s defining query. C. This is incorrect because views can join tables from different schemas, not just the same schema. B. Correct. The rows inserted into a base table via a view remain in the table even if the view is dropped because the view is just a window to the data in the base tables. D. Correct. Views do not require storage space other than for the definition of the view in the data dictionary, hence they have no segment. E. Incorrect. Views do not have object numbers because they are not database objects that occupy physical space. F. Correct. You can create a view that references non-existent tables; such a view would be considered invalid until the base table is created. The Oracle Database Concepts guide provides information about views and their characteristics. Page 6 of 7 https://pass2certify.com//exam/1z0-071 Need more info? Check the link below: https://pass2certify.com/exam/1z0-071 Thanks for Being a Valued Pass2Certify User! Guaranteed Success Pass Every Exam with Pass2Certify. Save $15 instantly with promo code SAVEFAST Sales: sales@pass2certify.com Support: support@pass2certify.com Page 7 of 7 https://pass2certify.com//exam/1z0-071