| 1. | What is the correct use of the Trunc command on a date? |
| a. | | TRUNC=To_Date('09-Jan-02,DD-MON-YY,'YEAR',"Date" from Dual; |
| b. | | Select TRUNC(To_Date('09-Jan-02,DD-MON-YY,YEAR')) "DATE" from Dual; |
| c. | | Date =TRUNC(To_DATE('09-Jan-02','DD-MON-YY'),'YEAR'),'YEAR)"DATE: from DUAL; |
| d. | | SELECT TRUNC(TO_DATE('12-Feb-99','DD-MON-YY'), 'YEAR') "Date " FROM DUAL;
|
|
|
|
|
|
|
| 2. | Which type of join should be written to perform an outer join of tables A and B that returns all rows from B? |
| a. | | Any outer join |
| b. | | A left outer join |
| c. | | A cross join |
| d. | | A right outer join |
| e. | | An inner join
|
|
|
|
|
|
|
| 3. | How many join conditions should be there to avoid a Cartesian Join for joining three tables? |
| a. | | 1 |
| b. | | 2 |
| c. | | 3 |
| d. | | None of the above
|
|
|
|
|
|
|
| 4. | Top N analysis requires ____________ and ____________. |
| a. | | The use of rowed & Only an inline view |
| b. | | a GROUP BY clause & Only an inline view |
| c. | | an ORDER BY clause & An inline view and an outer query |
| d. | | None of the above
|
|
|
|
|
|
|
| 5. | Examine the code given below:
SELECT employee_id FROM employees WHERE commission_pct=.5 OR salary > 23000
Which of the following statement is correct with regard to this code? |
| a. | | It returns employees who have 50% of the salary greater than $23,000: |
| b. | | It returns employees who have 50% commission rate or salary greater than $23,000: |
| c. | | It returns employees who have 50% of salary less than $23,000: |
| d. | | None of the above
|
|
|
|
|
|
|
| 6. | The STUDENT_GRADES table has the following columns:
| STUDENT_ID | NUMBER (12) |
| SEMESTER_END | DATE |
| GPA | NUMBER (4, 3) |
Which of the following statements finds the highest Grade Point Average (GPA) per semester? |
| a. | | SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL; |
| b. | | SELECT (gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL; |
| c. | | SELECT MAX(gpa) FROM student_grades WHERE gpa IS NOT NULL GROUP BY semester_end; |
| d. | | SELECT MAX(gpa) GROUP BY semester_end WHERE gpa IS NOT NULL FROM student_grades; |
| e. | | SELECT MAX(gpa) FROM student_grades GROUP BY semester_end WHERE gpa IS NOT NULL;
|
|
|
|
|
|
|
| 7. | Which of the following tasks can be performed by using the TO_CHAR function? |
| a. | | Convert '10'to 10 |
| b. | | Convert 10 to '10' |
| c. | | Convert 'TEN' to 10 |
| d. | | Convert a date to a character expression |
| e. | | Convert a character expression to a date
|
|
|
|
|
|
|
| 8. | Which of the following SELECT statements will get the result 'elloworld' from the string 'HelloWorld'? |
| a. | | SELECT SUBSTR ('HelloWorld',1) FROM dual; |
| b. | | SELECT INITCAP(TRIM('HellowWorld', 1,1) FROM dual; |
| c. | | SELECT LOWER (SUBSTR ('HellowWorld', 2,1) FROM dual; |
| d. | | SELECT LOWER (SUBSTR('HellowWorld', 2,1) FROM dual; |
| e. | | SELECT LOWER (TRIM ('H' FROM 'Hello World')) FROM dual;
|
|
|
|
|
|
|
| 9. | Where is the GROUP BY clause statement placed in a SELECT statement that includes a WHERE clause? |
| a. | | Immediately after the SELECT clause |
| b. | | Before the WHERE clause |
| c. | | After the ORDER BY clause |
| d. | | After the WHERE clause
|
|
|
|
|
|
|
| 10. | Which operators can be used in an outer join condition? |
| a. | | = |
| b. | | OR |
| c. | | IN |
| d. | | AND
|
|
|
|
|
|
|
| 11. | Which type of view is implemented as a subquery embedded in the FROM clause of a SELECT statement and is identified by an alias? |
| a. | | Simple |
| b. | | Inline |
| c. | | Complex |
| d. | | Nested
|
|
|
|
|
|
|
| 12. | Evaluate the following SQL statement:
SELECT ROUND (TRUNC (MOD (1600, 10),-1), 2) FROM dual;
What will be displayed? |
| a. | | 0 |
| b. | | 1 |
| c. | | 0.00 |
| d. | | An error statement
|
|
|
|
|
|
|