Oracle 1Z0-051 Exam Questions and Answers 2021
Want to know 1z0 051 latest dumps free download pdf features? Want to lear more about 1z0 051 latest dumps free download pdf experience? Study oracle 1z0 051. Gat a success with an absolute guarantee to pass Oracle 1Z0-051 (Oracle Database: SQL Fundamentals I) test on your first attempt.
Check 1Z0-051 free dumps before getting the full version:
NEW QUESTION 1
Which one is a system privilege?
- A. SELECT
- B. DELETE
- C. EXECUTE
- D. ALTER TABLE
- E. CREATE TABLE
Answer: E
NEW QUESTION 2
View the Exhibits and examine PRODUCTS and SALES tables. 
You issue the following query to display product name and the number of times the product has been sold:
SQL>SELECT p.prod_name, i.item_cnt FROM (SELECT prod_id, COUNT(*) item_cnt FROM sales GROUP BY prod_id) i RIGHT OUTER JOIN products p
ON i.prod_id = p.prod_id;
What happens when the above statement is executed?
- A. The statement executes successfully and produces the required outpu
- B. The statement produces an error because ITEM_CNT cannot be displayed in the outer quer
- C. The statement produces an error because a subquery in the FROM clause and outer-joins cannot be used togethe
- D. The statement produces an error because the GROUP BY clause cannot be used in a subquery in the FROM claus
Answer: A
NEW QUESTION 3
Which constraint can be defined only at the column level?
- A. UNIQUE
- B. NOT NULL
- C. CHECK
- D. PRIMARY KEY
- E. FOREIGN KEY
Answer: B
Explanation:
The NOT NULL constraint can be defined only at the column level. It enforces that a value must be defined for this column such that the column may not be NULL for any row.
Incorrect Answers A:The UNIQUE constraint enforces uniqueness on values in the constrained column. It can be defined not only at the column level. C:The CHECK constraint enforces that values added to the constrained column must be present in a static list of values permitted for the column.
D:The PRIMARY KEY constraint stipulates that values in the constrained column(s) must be unique and not NULL. If the primary key applies to multiple columns, then the combination of values in the columns must be unique and not NULL. E:The FOREIGN KEY constraint enforces that only values in the primary key of a parent table may be included as values in the constrained column(s) of the child table.
OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 227-232 Chapter 5: Creating Oracle Database Objects
NEW QUESTION 4
Where can sub queries be used? (Choose all that apply)
- A. field names in the SELECT statement
- B. the FROM clause in the SELECT statement
- C. the HAVING clause in the SELECT statement
- D. the GROUP BY clause in the SELECT statement
- E. the WHERE clause in only the SELECT statement
- F. the WHERE clause in SELECT as well as all DML statements
Answer: ABCF
Explanation:
SUBQUERIES can be used in the SELECT list and in the FROM, WHERE, and HAVING
clauses of a query.
A subquery can have any of the usual clauses for selection and projection. The following
are required clauses:
A SELECT list
A FROM clause
The following are optional clauses: WHERE GROUP BY HAVING
The subquery (or subqueries) within a statement must be executed before the parent query that calls it, in order that the results of the subquery can be passed to the parent.
NEW QUESTION 5
The DBA issues this SQL command:
CREATE USER scott IDENTIFIED by tiger;
What privileges does the user Scott have at this point?
- A. no privileges
- B. only the SELECT privilege
- C. only the CONNECT privilege
- D. all the privileges of a default user
Answer: A
Explanation:
when a user is created, by default no privilege is granted
Incorrect Answer:
BSELECT is not grant
CCONNECT is not grant
Ddefault profile is grant by default not privilege.
Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 13-6
NEW QUESTION 6
EMPLOYEES and DEPARTMENTS data: EMPLOYEES 
DEPARTMENTS 
On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID managers and refers to the EMPLOYEE_ID.
On the DEPARTMENTS table DEPARTMENT_ID is the primary key.
Evaluate this UPDATE statement.
UPDATE employees SET mgr_id = (SELECT mgr_id FROMemployees WHERE dept_id= (SELECT department_id FROM departments WHERE department_name = 'Administration')), Salary = (SELECT salary
FROM employees
WHERE emp_name = 'Smith')
WHERE job_id = 'IT_ADMIN';
What happens when the statement is executed?
- A. The statement executes successfully, leaves the manager ID as the existing value, and changes the salary to 4000 for the employees with ID 103 and 105.
- B. The statement executes successfully, changes the manager ID to NULL, and changes the salary to 4000 for the employees with ID 103 and 105.
- C. The statement executes successfully, changes the manager ID to NULL, and changes the salary to 3000 for the employees with ID 103 and 105.
- D. The statement fails because there is more than one row matching the employee name Smit
- E. The statement fails because there is more than one row matching the IT_ADMIN job ID in the EMPLOYEES tabl
- F. The statement fails because there is no 'Administration' department in the DEPARTMENTS tabl
Answer: D
Explanation:
'=' is use in the statement and sub query will return more than one row.
Employees table has 2 row matching the employee name Smith.
The update statement will fail.
Incorrect Answers :
A. The Update statement will fail no update was done.
B. The update statement will fail no update was done.
C. The update statement will fail no update was done.
E. The update statement will fail but not due to job_it='IT_ADMIN'
F. The update statement will fail but not due to department_id='Administration'
Refer: Introduction to Oracle9i: SQL, Oracle University Student Guide, Sub queries, p. 6-12
NEW QUESTION 7
Which three statements are true regarding sub queries? (Choose three.)
- A. Multiple columns or expressions can be compared between the main query and sub query
- B. Main query and sub query can get data from different tables
- C. Sub queries can contain GROUP BY and ORDER BY clauses
- D. Main query and sub query must get data from the same tables
- E. Sub queries can contain ORDER BY but not the GROUP BY clause
- F. Only one column or expression can be compared between the main query and subqeury
Answer: ABC
NEW QUESTION 8
View the Exhibit and examine the structure of the CUSTOMERS table.
You have been asked to produce a report on the CUSTOMERS table showing the customers details sorted in descending order of the city and in the descending order of their income level in each city. Which query would accomplish this task? 
- A. SELECT cust_city, cust_income_level, cust_last_name FROM customers ORDER BY cust_city desc, cust_income_level DESC;
- B. SELECT cust_city, cust_income_level, cust_last_name FROM customers ORDER BY cust_income_level desc, cust_city DESC;
- C. SELECT cust_city, cust_income_level, cust_last_name FROM customers ORDER BY (cust_city, cust_income_level) DESC;
- D. SELECT cust_city, cust_income_level, cust_last_name FROM customers ORDER BY cust_city, cust_income_level DESC;
Answer: A
NEW QUESTION 9
Examine the structure of the PRODUCTS table: 
You want to display the names of the products that have the highest total value for UNIT_PRICE *QTY_IN_HAND.
Which SQL statement gives the required output?
- A. SELECT prod_name FROM products WHERE (unit_price * qty_in_hand) = (SELECT MAX(unit_price * qty_in_hand) FROM products);
- B. SELECT prod_name FROM products WHERE (unit_price * qty_in_hand) = (SELECT MAX(unit_price * qty_in_hand) FROM products GROUP BY prod_name);
- C. SELECT prod_name FROM products GROUP BY prod_name HAVING MAX(unit_price * qty_in_hand) = (SELECT MAX(unit_price * qty_in_hand) FROM products GROUP BY prod_name);
- D. SELECT prod_name FROM products WHERE (unit_price * qty_in_hand) = (SELECT MAX(SUM(unit_price * qty_in_hand)) FROM products) GROUP BY prod_name;
Answer: A
NEW QUESTION 10
What is true about updates through a view?
- A. You cannot update a view with group function
- B. When you update a view group functions are automatically compute
- C. When you update a view only the constraints on the underlying table will be in effec
- D. When you update a view the constraints on the views always override the constraints on the underlying table
Answer: A
NEW QUESTION 11
Which two statements are true regarding views? (Choose two.)
- A. A sub query that defines a view cannot include the GROUP BY clause
- B. A view is created with the sub query having the DISTINCT keyword can be updated
- C. A Data Manipulation Language (DML) operation can be performed on a view that is created with the sub query having all the NOT NULL columns of a table
- D. A view that is created with the sub query having the pseudo column ROWNUM keyword cannot be updated
Answer: CD
Explanation:
Rules for Performing DML Operations on a View You cannot add data through a view if the view includes: Group functions A GROUP BY clause The DISTINCT keyword The pseudocolumn ROWNUM keyword Columns defined by expressions NOT NULL columns in the base tables that are not selected by the view
NEW QUESTION 12
Which two statements complete a transaction? (Choose two)
- A. DELETE employees;
- B. DESCRIBE employees;
- C. ROLLBACK TO SAVEPOINT C;
- D. GRANT SELECT ON employees TO SCOTT;
- E. ALTER TABLE employeesSET UNUSED COLUMN sal;
- F. Select MAX(sal)FROM employeesWHERE department_id = 20;
Answer: DE
Explanation:
D: GRANT is a DML operation which will cause an implicit commit
E: It is important to understand that an implicit COMMIT occurs on the database when a user exits SQL*Plus or issues a data-definition language (DDL) command such as a CREATE TABLE statement, used to create a database object, or an ALTER TABLE statement, used to alter a database object.
Incorrect Answers A:The DELETE command is data-manipulation language (DML) command and it does not complete a transaction. B:The DESCRIBE command is internal SQL*Plus command and it has nothing to do with completion a transaction.
C: ROLLBACK is not used to commit or complete a transaction, it is used to undo a transaction F:SELECT command is used to retrieve data. It does not complete a transaction.
OCP Introduction to Oracle 9i: SQL Exam Guide, Jason Couchman, p. 281-282 Chapter 3: Advanced Data Selection in Oracle
NEW QUESTION 13
In which four clauses can a sub query be used? (Choose four.)
- A. in the INTO clause of an INSERT statement
- B. in the FROM clause of a SELECT statement
- C. in the GROUP BY clause of a SELECT statement
- D. in the WHERE clause of a SELECT statement
- E. in the SET clause of an UPDATE statement
- F. in the VALUES clause of an INSERT statement
Answer: ABDE
Explanation:
A: a sub query is valid on the INTO clause of an ISERT Statement
B: a sub query can be used in the FROM clause of a SELECT statement
D: a sub query can be used in the WHERE clause of a SELECT statement,
E: a sub query can be used in the SET clauses of an UPDATE statement,
Incorrect Answer:
Csub query cannot be used
F: is incorrect.
Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 6-5
NEW QUESTION 14
View the Exhibit and examine the structure of ORDERS and CUSTOMERS tables. 
There is only one customer with the CUST_LAST_NAME column having value Roberts. Which INSERT statement should be used to add a row into the ORDERS table for the customer whose CUST_LAST_NAME is Roberts and CREDIT_LIMIT is 600?
- A. INSERT INTO orders VALUES (1,'10-mar-2007', 'direct', (SELECT customer_id FROM customers WHERE cust_last_name='Roberts' AND credit_limit=600), 1000);
- B. INSERT INTO orders (order_id,order_date,order_mode, (SELECT customer_id FROM customers WHERE cust_last_name='Roberts' AND credit_limit=600),order_total) VALUES(1,'10-mar-2007', 'direct', &&customer_id, 1000);
- C. INSERT INTO(SELECT o.order_id, o.order_date,o.order_mode,c.customer_id, o.order_total FROM orders o, customers c WHERE o.customer_id = c.customer_id AND c.cust_last_name='Roberts' ANDc.credit_limit=600 ) VALUES (1,'10-mar-2007', 'direct',(SELECT customer_id FROM customers WHERE cust_last_name='Roberts' AND credit_limit=600), 1000);
- D. INSERT INTO orders (order_id,order_date,order_mode, (SELECT customer_id FROM customers WHERE cust_last_name='Roberts' AND credit_limit=600),order_total) VALUES(1,'10-mar-2007', 'direct', &customer_id, 1000);
Answer: A
NEW QUESTION 15
View the Exhibit and examine the description for the PRODUCTS and SALES table. 
PROD_ID is a primary key in the PRODUCTS table and foreign key in the SALES table. You want to remove all the rows from the PRODUCTS table for which no sale was done for the last three years. Which is the valid DELETE statement?
- A. DELETE FROM products WHERE prod_id = (SELECT prod_id FROM sales WHERE time_id - 3*365 = SYSDATE );
- B. DELETE FROM products WHERE prod_id = (SELECT prod_id FROM sales WHERE SYSDATE >= time_id - 3*365 );
- C. DELETE FROM products WHERE prod_id IN (SELECT prod_id FROM sales WHERE SYSDATE - 3*365 >= time_id);
- D. DELETE FROM products WHERE prod_id IN (SELECT prod_id FROM sales WHERE time_id >= SYSDATE - 3*365 );
Answer: C
NEW QUESTION 16
Examine the structure of the EMPLOYEES and NEW_EMPLOYEES tables: 
Which DELETE statement is valid?
- A. DELETE FROM employees WHERE employee_id = (SELECT employee_id FROM employees);
- B. DELETE * FROM employees WHERE employee_id = (SELECT employee_id FROM new_employees);
- C. DELETE FROM employees WHERE employee_id IN(SELECT employee_id FROM new_employees WHERE name = 'Carrey');
- D. DELETE * FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE last_name = 'Carrey');
Answer: C
Explanation:
The correct syntax for DELETE statement
DELETE [ FROM ] table
[ WHERE condition ];
Incorrect Answers :
A. '=' is use in the statement and sub query will return more than one row.
Error Ora-01427: single-row sub query returns more than one row.
B. Incorrect DELETE statement
D. Incorrect DELETE statement
Refer: Introduction to Oracle9i: SQL, Oracle University Student Guide, Manipulating Data,
p. 8-19
100% Valid and Newest Version 1Z0-051 Questions & Answers shared by 2passeasy, Get Full Dumps HERE: https://www.2passeasy.com/dumps/1Z0-051/ (New 292 Q&As)