aiotestking uk

1Z0-051 Exam Questions - Online Test


1Z0-051 Premium VCE File

Learn More 100% Pass Guarantee - Dumps Verified - Instant Download
150 Lectures, 20 Hours

Q1. - (Topic 2) 

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

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

A. Display the minimum list price for each product status. 

B. Display all suppliers whose list price is less than 1000. 

C. Display the number of products whose list price is more than the average list price. 

D. Display the total number of products supplied by supplier 102 and have product status as 'obsolete'. 

E. Display all products whose minimum list price is more than the average list price of products and have the status 'orderable'. 

Answer: C,E 

Q2. - (Topic 1) 

Examine the description of the EMP_DETAILS table given below: Exhibit: 

Which two statements are true regarding SQL statements that can be executed on the EMP_DETAIL table? (Choose two.) 

A. An EMP_IMAGE column can be included in the GROUP BY clause 

B. You cannot add a new column to the table with LONG as the data type 

C. An EMP_IMAGE column cannot be included in the ORDER BY clause 

D. You can alter the table to include the NOT NULL constraint on the EMP_IMAGE column 

Answer: B,C 

Explanation: 

LONG Character data in the database character set, up to 2GB. All the functionality of LONG (and more) is provided by CLOB; LONGs should not be used in a modern database, and if your database has any columns of this type they should be converted to CLOB. 

There can only be one LONG column in a table. 

Guidelines 

A LONG column is not copied when a table is created using a subquery. 

A LONG column cannot be included in a GROUP BY or an ORDER BY clause. 

Only one LONG column can be used per table. 

No constraints can be defined on a LONG column. 

You might want to use a CLOB column rather than a LONG column. 

Q3. - (Topic 2) 

Which are iSQL*Plus commands? (Choose all that apply.) 

A. INSERT 

B. UPDATE 

C. SELECT 

D. DESCRIBE 

E. DELETE 

F. RENAME 

Answer:

Explanation: 

The only SQL*Plus command in this list : DESCRIBE. It cannot be used as SQL command. This command returns a description of tablename, including all columns in that table, the datatype for each column and an indication of whether the column permits storage of NULL values. 

Incorrect Answer: A INSERT is not a SQL*PLUS command B UPDATE is not a SQL*PLUS command C SELECT is not a SQL*PLUS command E DELETE is not a SQL*PLUS command F RENAME is not a SQL*PLUS command 

Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 7 

Q4. - (Topic 2) 

Evaluate the SQL statement: 

SELECT ROUND(45.953, -1), TRUNC(45.936, 2) 

FROM dual; 

Which values are displayed? 

A. 46 and 45 

B. 46 and 45.93 

C. 50 and 45.93 

D. 50 and 45.9 

E. 45 and 45.93 

F. 45.95 and 45.93 

Answer:

Explanation: 

ROUND (45.953,-1) will round value to 1 decimal places to the left. TRUNC (45.936,2) will truncate value to 2 decimal The answer will be 50 and 45.93 

Incorrect Answers : 

A. Does not meet round and truncate functions 

B. Does not meet round functions 

D. Does not meet truncate functions 

E. Does not meet round functions 

F. Does not meet round functions 

Refer: Introduction to Oracle9i: SQL, Oracle University Student Guide, Single-Row functions, p. 3-13 

Q5. - (Topic 1) 

See the exhibit and examine the structure of the CUSTOMERS and GRADES tables: 

You need to display names and grades of customers who have the highest credit limit. 

Which two SQL statements would accomplish the task? (Choose two.) 

A. 

SELECT custname, grade 

FROM customers, grades 

WHERE (SELECT MAX(cust_credit_limit) 

FROM customers) BETWEEN startval and endval; 

B. 

SELECT custname, grade FROM customers, grades WHERE (SELECT MAX(cust_credit_limit) FROM customers) BETWEEN startval and endval AND cust_credit_limit BETWEEN startval AND endval; 

C. 

SELECT custname, grade 

FROM customers, grades 

WHERE cust_credit_limit = (SELECT MAX(cust_credit_limit) 

FROM customers) 

AND cust_credit_limit BETWEEN startval AND endval; 

D. 

SELECT custname, grade 

FROM customers , grades 

WHERE cust_credit_limit IN (SELECT MAX(cust_credit_limit) 

FROM customers) 

AND MAX(cust_credit_limit) BETWEEN startval AND endval; 

Answer: B,C 

Q6. - (Topic 2) 

You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. 

Which statement accomplishes this task? 

A. ALTER TABLE students ADD PRIMARY KEY student_id; 

B. ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id); 

C. ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id; 

D. ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id); E. ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id); 

Answer:

Explanation: 

ALTER TABLE table_name 

ADD [CONSTRAINT constraint] type (coloumn); 

Incorrect Answer: 

Awrong syntax 

Bwrong syntax 

Cwrong syntax 

Eno such MODIFY keyword 

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

Q7. - (Topic 1) 

What is true about sequences? 

A. The start value of the sequence is always 1. 

B. A sequence always increments by 1. 

C. The minimum value of an ascending sequence defaults to 1. 

D. The maximum value of descending sequence defaults to 1. 

Answer:

Q8. - (Topic 2) 

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

You want to generate a report showing the last names and credit limits of all customers 

whose last names start with A, B, or C, and credit limit is below 10, 000. 

Evaluate the following two queries: 

Which statement is true regarding the execution of the above queries? 

A. Only the first query gives the correct result. 

B. Only the second query gives the correct result. 

C. Both execute successfully and give the same result. 

D. Both execute successfully but do not give the required result. 

Answer:

Q9. - (Topic 1) 

View the Exhibit and examine the structure of the CUSTOMERS and CUST_HISTORY tables. 

The CUSTOMERS table contains the current location of all currently active customers. The CUST_HISTORY table stores historical details relating to any changes in the location of all current as well as previous customers who are no longer active with the company. 

You need to find those customers who have never changed their address. 

Which SET operator would you use to get the required output? 

A. INTERSECT 

B. UNION ALL 

C. MINUS 

D. UNION 

Answer:

Q10. - (Topic 2) 

You want to display the date for the first Monday of the next month and issue the following command: 

SQL>SELECT TO_CHAR(NEXT_DAY(LAST_DAY(SYSDATE),'MON'), 'dd "is the first Monday for"fmmonth rrrr') FROM DUAL; 

What is the outcome? 

A. It executes successfully and returns the correct result. 

B. It executes successfully but does not return the correct result. 

C. It generates an error because TO_CHAR should be replaced with TO_DATE. 

D. It generates an error because rrrr should be replaced by rr in the format string. 

E. It generates an error because fm and double quotation marks should not be used in the format string. 

Answer:

Explanation: 

NEXT_DAY(date, 'char'): Finds the date of the next specified day of the week ('char') following date. The value of char may be a number representing a day or a character string. 

LAST_DAY(date): Finds the date of the last day of the month that contains date The second innermost function is evaluated next. TO_CHAR('28-OCT-2009', 'fmMonth') converts the given date based on the Month format mask and returns the character string October. The fm modifier trims trailing blank spaces from the name of the month.