Actualtests 1Z0-051 Oracle Database: SQL Fundamentals I exercise test will be the best option so that you can plan for the particular Oracle test. If you wish to be considered a prominent Actualtests technicians, you can not pass by the particular Actualtests 1Z0-051 Oracle Database: SQL Fundamentals I materials supply. Learn not only the actual 1Z0-051 test questions but the detailed explanation. Transferring Oracle 1Z0-051 certification is the first most important thing, moreover, one can learn many specific understanding as well as experiences that will utilized in the future of exercise function.

2016 Jun 1Z0-051 real exam

Q71. - (Topic 1) 

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

The ORD_NO column is PRIMARY KEY in the ORD table and the ORD_NO and ITEM_NO 

columns are composite PRIMARY KEY in the ORD_ITEMS table. 

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


A. CREATE INDEX ord_idx1 

ON ord(ord_no); 

B. CREATE INDEX ord_idx2 

ON ord_items(ord_no); 

C. CREATE INDEX ord_idx3 

ON ord_items(item_no); 

D. CREATE INDEX ord_idx4 

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

Answer: B,C 

Explanation: How Are Indexes Created? 

You can create two types of indexes. 

Unique index: The Oracle server automatically creates this index when you define a 

column in a table to have a PRIMARY KEY or a UNIQUE constraint. The name of the index 

is the name that is given to the constraint. 

Nonunique index: This is an index that a user can create. For example, you can create 

the FOREIGN KEY column index for a join in a query to improve the speed of retrieval. 

Note: You can manually create a unique index, but it is recommended that you create a 

unique constraint, which implicitly creates a unique index. 


Q72. - (Topic 1) 

See the Exhibit and examine the structure and data in the INVOICE table: Exhibit: 


Which two SQL statements would execute successfully? (Choose two.) 

A. SELECT MAX(inv_date),MIN(cust_id) FROM invoice; 

B. SELECT AVG(inv_date-SYSDATE),AVG(inv_amt) FROM invoice; 

C. SELECT MAX(AVG(SYSDATE-inv_date)) FROM invoice; 

D. SELECT AVG(inv_date) FROM invoice; 

Answer: A,B 


Q73. - (Topic 2) 

Examine the SQL statement that creates ORDERS table: 

CREATE TABLE orders (SER_NO NUMBER UNIQUE, ORDER_ID NUMBER, ORDER_DATE DATE NOT NULL, STATUS VARCHAR2(10) CHECK (status IN ('CREDIT', 'CASH')), PROD_ID NUMBER REFERENCES PRODUCTS(PRODUCT_ID), ORD_TOTAL NUMBER, PRIMARY KEY (order_id, order_date)); 

For which columns would an index be automatically created when you execute the above SQL statement? (Choose two.) 

A. SER_NO 

B. ORDER_ID 

C. STATUS 

D. PROD_ID 

E. ORD_TOTAL 

F. composite index on ORDER_ID and ORDER_DATE 

Answer: A,F 

Explanation: Index exist for UNIQUE and PRIMARY KEY constraints 

Incorrect Answer: BORDER_ID is neither UNIQUE nor PRIMARY KEY CSTATUS is neither UNIQUE nor PRIMARY KEY DPROD_ID is neither UNIQUE nor PRIMARY KEY EORD_TOTAL is neither UNIQUE nor PRIMARY KEY 

Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 10-15 


Q74. - (Topic 2) 

View the Exhibit and examine the structure of the PRODUCT, COMPONENT, and PDT_COMP tables.

 

In PRODUCT table, PDTNO is the primary key. 

In COMPONENT table, COMPNO is the primary key. 

In PDT_COMP table, (PDTNO,COMPNO) is the primary key, PDTNO is the foreign key referencing PDTNO in PRODUCT table and COMPNO is the foreign key referencing the COMPNO in COMPONENT table. 

You want to generate a report listing the product names and their corresponding component names, if the component names and product names exist. 

Evaluate the following query: 

SQL>SELECT pdtno,pdtname, compno,compname FROM product _____________ pdt_comp USING (pdtno) ____________ component USING(compno) 

WHERE compname IS NOT NULL; 

Which combination of joins used in the blanks in the above query gives the correct output? 

A. JOIN; JOIN 

B. FULL OUTER JOIN; FULL OUTER JOIN 

C. RIGHT OUTER JOIN; LEFT OUTER JOIN 

D. LEFT OUTER JOIN; RIGHT OUTER JOIN 

Answer: C


Q75. - (Topic 1) 

Examine the structure of the EMPLOYEES table: 


You want to create a SQL script file that contains an INSERT statement. When the script is run, the INSERT statement should insert a row with the specified values into the EMPLOYEES table. The INSERT statement should pass values to the table columns as specified below:

 

Which INSERT statement meets the above requirements? 

A. INSERT INTO employees VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did); 

B. INSERT INTO employees VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did IN (20,50)); 

C. INSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50)) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did); 

D. INSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50) WITH CHECK OPTION) 

VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did); 

E. INSERT INTO (SELECT * FROM employees WHERE (department_id = 20 AND department_id = 50) WITH CHECK OPTION ) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did); 

Answer: D 


certifyforall.com

Up to the minute oracle 1z0-051:

Q76. - (Topic 1) 

Examine the statement: 

Create synonym emp for hr.employees; 

What happens when you issue the statement? 

A. An error is generated. 

B. You will have two identical tables in the HR schema with different names. 

C. You create a table called employees in the HR schema based on you EMP table. 

D. You create an alternative name for the employees table in the HR schema in your own schema. 

Answer: D 


Q77. - (Topic 1) 

View the Exhibit and examine the structure of the SALES table. 

The following query is written to retrieve all those product IDs from the SALES table that have more than 55000 sold and have been ordered more than 10 times. 


Which statement is true regarding this SQL statement? 


A. It executes successfully and generates the required result. 

B. It produces an error because COUNT(*) should be specified in the SELECT clause also. 

C. It produces an error because COUNT(*) should be only in the HAVING clause and not in the WHERE clause. 

D. It executes successfully but produces no result because COUNT(prod_id) should be used instead of COUNT(*). 

Answer: C 

Explanation: 

Restricting Group Results with the HAVING Clause 

You use the HAVING clause to specify the groups that are to be displayed, thus further 

restricting the groups on the basis of aggregate information. 

In the syntax, group_condition restricts the groups of rows returned to those groups for 

which the specified condition is true. 

The Oracle server performs the following steps when you use the HAVING clause: 

1. 

Rows are grouped. 

2. 

The group function is applied to the group. 

3. 

The groups that match the criteria in the HAVING clause are displayed. 

The HAVING clause can precede the GROUP BY clause, but it is recommended that you 

place the GROUP BY clause first because it is more logical. Groups are formed and group 

functions are calculated before the HAVING clause is applied to the groups in the SELECT 

list. 

Note: The WHERE clause restricts rows, whereas the HAVING clause restricts groups. 


Q78. - (Topic 1) 

See the Exhibit and examine the structure of ORD table: Exhibit: 


Evaluate the following SQL statements that are executed in a user session in the specified order: 

CREATE SEQUENCE ord_seq; 

SELECT ord_seq.nextval 

FROM dual; 

INSERT INTO ord 

VALUES (ord_seq.CURRVAL, ’25-jan-2007,101); 

UPDATE ord 

SET ord_no= ord_seq.NEXTVAL 

WHERE cust_id =101; 

What would be the outcome of the above statements? 

A. All the statements would execute successfully and the ORD_NO column would contain the value 2 for the CUST_ID 101. 

B. The CREATE SEQUENCE command would not execute because the minimum value and maximum value for the sequence have not been specified. 

C. The CREATE SEQUENCE command would not execute because the starting value of the sequence and the increment value have not been specified. 

D. All the statements would execute successfully and the ORD_NO column would have the value 20 for the CUST_ID 101 because the default CACHE value is 20. 

Answer: A 


Q79. - (Topic 1) 

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) that stores the employee name 

3. 

Hire date, which stores the date of joining the organization for each employee 

4. 

Status (character data type), that contains the value 'ACTIVE' if no data is entered 

5. 

Resume (character large object [CLOB] data type), which contains the resume submitted by the employee 

Which is the correct syntax to create this table? 

A. CREATE TABLE EMP_1 

(emp_id NUMBER(4), 

emp_name VARCHAR2(25), 

start_date DATE, 

e_status VARCHAR2(10) DEFAULT 'ACTIVE', 

resume CLOB(200)); 

B. CREATE TABLE 1_EMP 

(emp_id NUMBER(4), 

emp_name VARCHAR2(25), 

start_date DATE, 

emp_status VARCHAR2(10) DEFAULT 'ACTIVE', 

resume CLOB); 

C. CREATE TABLE EMP_1 

(emp_id NUMBER(4), 

emp_name VARCHAR2(25), 

start_date DATE, 

emp_status VARCHAR2(10) DEFAULT "ACTIVE", 

resume CLOB); 

D. CREATE TABLE EMP_1 

(emp_id NUMBER, 

emp_name VARCHAR2(25), 

start_date DATE, 

emp_status VARCHAR2(10) DEFAULT 'ACTIVE', 

resume CLOB); 

Answer: D 

Explanation: 

CLOB Character data (up to 4 GB) 

NUMBER [(p,s)] Number having precision p and scale s (Precision is the total number of 

decimal digits and scale is the number of digits to the right of the decimal point; precision 

can range from 1 to 38, and scale can range from –84 to 127.) 


Q80. - (Topic 2) 

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

A. A subquery can retrieve zero or more rows. 

B. Only two subqueries can be placed at one level. 

C. A subquery can be used only in SQL query statements. 

D. A subquery can appear on either side of a comparison operator. 

E. There is no limit on the number of subquery levels in the WHERE clause of a SELECT statement. 

Answer: A,D 

Explanation: 

Using a Subquery to Solve a Problem Suppose you want to write a query to find out who earns a salary greater than Abel’s salary. To solve this problem, you need two queries: one to find how much Abel earns, and a second query to find who earns more than that amount. You can solve this problem by combining the two queries, placing one query inside the other query. The inner query (or subquery) returns a value that is used by the outer query (or main query). Using a subquery is equivalent to performing two sequential queries and using the result of the first query as the search value in the second query. Subquery Syntax A subquery is a SELECT statement that is embedded in the clause of another SELECT statement. You can build powerful statements out of simple ones by using subqueries. They can be very useful when you need to select rows from a table with a condition that depends on the data in the table itself. You can place the subquery in a number of SQL clauses, including the following: WHERE clause HAVING clause FROM clause In the syntax: operator includes a comparison condition such as >, =, or IN Note: Comparison conditions fall into two classes: single-row operators (>, =, >=, <, <>, <=) and multiple-row operators (IN, ANY, ALL, EXISTS). The subquery is often referred to as a nested SELECT, sub-SELECT, or inner SELECT statement. The subquery generally executes first, and its output is used to complete the query condition for the main (or outer) query. Guidelines for Using Subqueries Enclose subqueries in parentheses. Place subqueries on the right side of the comparison condition for readability. (However, the subquery can appear on either side of the comparison operator.) Use single-row operators with single-row subqueries and multiple-row operators with multiple-row subqueries. 

Subqueries can be nested to an unlimited depth in a FROM clause but to “only” 255 levels in a WHERE clause. They can be used in the SELECT list and in the FROM, WHERE, and HAVING clauses of a query.