Premium

Oracle Advanced SQL and PL/SQL Developer Certification Questions and Answers (Dumps and Practice Questions)



Question : What value is returned after executing the following statement?
LENGTH2('HadoopExam.com')
  : What value is returned after executing the following statement?
1. 12
2. 14
3. Access Mostly Uused Products by 50000+ Subscribers
4. Null



Correct Answer : Get Lastest Questions and Answer :
Exp: he Oracle/PLSQL LENGTH2 function returns the length of the specified string, using UCS2 code points.

SYNTAX

The syntax for the Oracle/PLSQL LENGTH2 function is:

LENGTH2( string1 )
Parameters or Arguments

string1 is the string to return the length for. string1 can be CHAR, VARCHAR2, NCHAR, or NVARCHAR2. string1 can not be CLOB or NCLOB.

NOTE

If string1 is NULL, then the LENGTH2 function will return NULL.






Question : What value is returned after executing the following statement?
SELECT supplier_id, supplier_name
FROM suppliers
WHERE supplier_id >= 500
UNION
SELECT company_id, company_name
FROM companies
WHERE company_name = 'Apple'
ORDER BY 2;
  : What value is returned after executing the following statement?
1. First Half data would be sorted based on supplier_name
2. Data would be sorted based on supplier_name but could be random because of different column names
3. Access Mostly Uused Products by 50000+ Subscribers
4. Error



Correct Answer : Get Lastest Questions and Answer :
Exp: The Oracle UNION operator is used to combine the result sets of 2 or more Oracle SELECT statements. It removes duplicate rows between the various SELECT statements.

Each SELECT statement within the UNION operator must have the same number of fields in the result sets with similar data types.

SYNTAX

The syntax for the Oracle UNION operator is:

SELECT expression1, expression2, ... expression_n
FROM tables
WHERE conditions
UNION
SELECT expression1, expression2, ... expression_n
FROM tables
WHERE conditions;
Parameters or Arguments

expression1, expression2, expression_n are the columns or calculations that you wish to retrieve.

tables are the tables that you wish to retrieve records from. There must be at least one table listed in the FROM clause.

conditions are conditions that must be met for the records to be selected.







Question : What value is returned after executing the following statement?
SELECT supplier_id, supplier_name
FROM suppliers
WHERE state = 'California'
UNION ALL
SELECT company_id, company_name
FROM companies
WHERE company_id > 1000
ORDER BY 2;
  : What value is returned after executing the following statement?
1. First Half data would be sorted based on supplier_name
2. Data would be sorted based on supplier_name but could be random because of different column names
3. Access Mostly Uused Products by 50000+ Subscribers
4. Error



Correct Answer : Get Lastest Questions and Answer :
Exp: In this Oracle UNION ALL operator, since the column names are different between the two SELECT statements, it is more advantageous to reference the columns in the ORDER BY clause by their position in the result set. In this example, we've sorted the results by supplier_name / company_name in ascending order, as denoted by the "ORDER BY 2".




Related Questions


Question : Which of these set operators will not sort the rows?
 : Which of these set operators will not sort the rows?
1. INTERSECT
2. MINUS
3. Access Mostly Uused Products by 50000+ Subscribers
4. UNION ALL




Question : Select the correct statement which applies to single-row functions?
 : Select the correct statement which applies to single-row functions?
1. It will always retun value else error
2. It will be executed for each record
3. Access Mostly Uused Products by 50000+ Subscribers
4. All of the above




Question : Select the function which could do case conversion on latter

 : Select the function which could do case conversion on latter
1. SMALLER
2. INITCASE
3. Access Mostly Uused Products by 50000+ Subscribers
4. All of the above




Question : What value is returned after executing the following statement?
LENGTH('Tech on the Net')
 : What value is returned after executing the following statement?
1. 15
2. 16
3. Access Mostly Uused Products by 50000+ Subscribers
4. 12




Question : What value is returned after executing the following statement?
LENGTH(NULL)
 : What value is returned after executing the following statement?
1. 0
2. 1
3. Access Mostly Uused Products by 50000+ Subscribers
4. Null




Question : What value is returned after executing the following statement?
LENGTH('')
 : What value is returned after executing the following statement?
1. 0
2. 1
3. Access Mostly Uused Products by 50000+ Subscribers
4. Null