Anda di halaman 1dari 10

ORACLE TEST Held on 07/12/09 PUNE Data warehousing Batch(RETEST) What will be the output of the following code:

de: DECLARE TYPE some_typ IS VARRAY(10) OF VARCHAR2(50); Var_1 some_typ := some_typ(arun, ajay); Var_2 some_typ := some_typ(akshay, anmol); BEGIN Var_1 := Var_2 ; DBMS_OUTPUT.PUT_LINE(Var_1(1)); END;

1. Arun 2. Akshay 3. Ajay 4. Anmol 5. None of these.

IN DBMS.FLASHBACK package DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER can be used any time to get the latest SCN:

1. TRUE 2. FALSE

Observe the following query for the table emp(emp_id, dept_id, salary) SELECT ROUND(MAX(sal)), ROUND(MIN(sal)), ROUND(SUM(sal)), ROUND(AVG(sal)) FROM

Emp

1. Returns Single row 2. Returns multiple rows 3. Return 4 rows 4. Shows error

In which Grid Architecture the management of Hardware and Software systems is done:

1. Information Grid 2. Application Grid 3. System Grid 4. Infrastructure Grid What is the output of the following PL/SQL Block DECLARE I NUMBER; J NUMBER; BEGIN I := 36; BEGIN J:= I/0; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(Other Handled); END; EXCEPTION

WHEN ZERO_DIVIDE THEN DBMS_OUTPUT.PUT_LINE(Zero Divide Handled); END;

1. Other Handled 2. Zero Divide Handled 3. Other Handled Zero Divide Handled 4. No Output

What is true about the following index: CREATE INDEX ind_name on DATABASE_EMPLOYEES.emp(LOWER(empid))

1. Creates a FUNCTIONAL index on DATABASE_EMPLOYEES Schema, emp table, empid Column 2. Creates a FUNCTIONAL index on emp table on empid column 3. Creates an index on emp table on empid column

Examine the following trigger CREATE TRIGGER Trigg_name BEFOR UPDATE ON EMP BEGIN Insert into Access values(user_name, sysdate); END;

An update command to update 7 Rows. No of rows updated in access table is

1. 1 2. 7 3. 0 4. None

Which of the following is true about the trigger

1. An application trigger is executed on update to table 2. A database trigger is executed on insert to table 3. An instead of trigger is executed on update to table 4. A sys event trigger is executed on insert to table

What is true about Data Dictionary (choose 3)

1. Describe database objects and give info about them. 2. It has base tables and dictionary views based on it. 3. Data dictionary tables are read only. 4. You can query a data dictionary using select commands 5. You need to update data dictionary view when a new table is created.

What is true about autonomous transactions?

1. Changes made to database by parent operation are not visible to child till total operation is finished. 2. Control is transferred from parent to child 3. All child operation must have commit or rollback

4. Parent & child operations share resource and locks on database tables. 5. Changes made to database by child transactions are retained.

1ST
1) select * from emp where id NOT IN ( select manager_id from .....), which operator is the same as NOT IN. a. != b. !=ALL * C. NOT LIKE d. !=ANY Ans: B

2) You would like to display the system date in the format "Monday, 01 June, 2001". Which SELECT statement should you use? A. SELECT TO_DATE (SYSDATE, 'FMDAY, DD Month, YYYY') FROM dual; B. SELECT TO_CHAR (SYSDATE, 'FMDD, DY Month, YYYY') FROM dual; C. SELECT TO_CHAR (SYSDATE, 'FMDay, DD Month, YYYY') FROM dual; D. SELECT TO_CHAR (SYSDATE, 'FMDY, DDD Month, YYYY') FROM dual; E. SELECT TO_DATE (SYSDATE, 'FMDY, DDD Month, YYYY') FROM dual;

3)You have decided to permanently remove all the data from the STUDENT table and you need the table structure in the future. Which single command performs this? A. DROP TABLE student; B. TRUNCATE TABLE student; C. DELETE* FROM student; D. TRUNCATE TABLE student KEEP STRUCTURE;

E. DELETE* FROM student KEEP STRUCTURE. Answer: B Explanation: Answer B is correct because after truncating table you delete all data and keep table and its structure for future use. Also command TRUNCATE reset highwatermark level to zero for table.

4)Evaluate this PL/SQL block. BEGIN FOR i IN 1..10 LOOP IF I=4 OR I=6 THEN null; ELSE INSERT INTO test(result) VALUES (I) ; END IF; COMMIT; END LOOP; ROLL BACK; END. 5)How many values will be inserted into the TEST table? A. 0 B. 4 C. 6 D. 8 E. 10

Answer: D Explanation: Answer D is correct because loop will be executed 10 times, but 2 times IF-THEN condition will not allow to insert 2 values into TEST table, so result is 8.

6)Which statement is valid regarding index clusters? A. Index clusters can only be used for tables with low cardinality columns. B. Index clusters are generally well suited for tables that have many full table scans. C. Normal B-Tree indexes do not store null key values, whereas cluster indexes store null keys. D. A cluster index always takes up much more storage space than a normal index for the same set of key values. Answer: C.

7)Which four statements are true regarding materialized views? (Choose four) A. Materialized views cannot be partitioned, nor can they be defined on partitioned tables. B. Materialized views are often used in data warehouses to increase the speed of queries on very large datatables. C. Queries that benefit from the use of materialized views often involve joins between tables or aggregations such as SUM. D. A materialized view stores both the definition of a view and the rows resulting from the execution of the views. E. Materialized views can be used to replicate data, which was formerly achieved using the CREATE SNAPSHOT statement. Answer: B, C, D, E.

8)You must permanently remove all data from the INVOICE table, but will need the table structure in the future. What single command should be issued? a. DROP TABLE invoice b. TRUNCATE TABLE invoice c. DELETE FROM invoice d. TRNCATE TABLE invoice KEEP STRUCTURE; ANSWER: C

9)SELECT ROUND(MAX(sale_price),2), ROUND(MIN(sale_price),2), ROUND(AVG(sale_price),2) FROM product GROUP BY sale_price; A: well i think it will return only single row....thats the answer of that question

10)Which three SELECT statements displays 2000 in the format $2,000.00? (Choose three) A. SELECT TO CNAR(2000, $#,###.##) FROM dual; B. SELECT TO CNAR(2000, $0,000.00) FROM dual; C. SELECT TO CNAR(2000, $9,999.00) FROM dual; D. SELECT TO CNAR(2000, $9,999.99) FROM dual;

E. SELECT TO CNAR(2000, $2,000.00) FROM dual; Answer: B, C, D

11)Which three are true regarding the use of outer joins? (Choose three.) A. You cannot use IN operator in a condition that involves an outerjoin. B. You use (+) on both sides of the WHERE condition to perform an outerjoin. C. You use (*) on both sides of the WHERE condition to perform an outerjoin. D. You use an outerjoin to see only the rows that do not meet the join condition. E. In the WHERE condition, you use (+) following the name of the column in the table without matching rows, to perform an outerjoin. F. You cannot link a condition that is involved in an outerjoin to another condition by using the OR operator. Answer: D, E, F Explanation: You can use an outerjoin to see only the rows that do not meet the join condition. In the WHERE condition, you use (+) following the name of the column in the table without matching rows, to perform an outerjoin. You cannot link a condition that is involved in an outerjoin to another condition by using the OR operator. 12)THE OUTPUT OF FOLLOWING CODE IS Declare n1 number := 20; n2 number := 10; n3 number;

begin n1 := 30; n2 := n1; n3 := n1 * n2; DBMS_OUTPUT.PUT_LINE(n1); DBMS_OUTPUT.PUT_LINE(n2); DBMS_OUTPUT.PUT_LINE(n3); end; A)30,30,900 B)WILL RETURN AN ERROR CORRECT ANSWER IS A)

Anda mungkin juga menyukai