2023 2024 Student Forum > Management Forum > Main Forum

 
  #2  
22nd July 2014, 02:40 PM
Super Moderator
 
Join Date: Apr 2013
Re: Placement Papers for Oracle Company

Here I am giving you question paper for placement examination of Oracle Company in a file attached with it so you can get it easily.




1. A certain number of men can finish a piece of work in 10 days. If however there were 10 men less it will take 10 days more for the work to be finished. How many men were there originally?

(A) 110 men

(B) 130 men

(C) 100 men

(D) none of these

2. In simple interest what sum amounts of Rs.1120/- in 4 years and Rs.1200/- in 5 years ?

(A) Rs. 500

(B) Rs. 600

(C) Rs. 800

(D) Rs. 900

3. If a sum of money compound annually amounts of thrice itself in 3 years. In how many years will it become 9 times itself.

(A) 6

(B) 8

(C) 10

(D) 12

4. Two trains move in the same direction at 50 kmph and 32 kmph respectively. A man in the slower train observes the 15 seconds elapse before the faster train completely passes by him.

What is the length of faster train ?

(A) 100m

(B) 75m

(C) 120m

(D) 50m

5. How many mashes are there in 1 squrare meter of wire gauge if each mesh is 8mm long and 5mm wide ?

(A) 2500

(B) 25000

(C) 250

(D) 250000

6. x% of y is y% of ?

(A) x/y

(B) 2y

(C) x

(D) can’t be determined

7. The price of sugar increases by 20%, by what % should a housewife reduce the consumption of sugar so that expenditure on sugar can be same as before ?

(A) 15%

(B) 16.66%

(C) 12%

(D) 9%

8. A man spends half of his salary on household expenses, 1/4th for rent, 1/5th for travel expenses, the man deposits the rest in a bank. If his monthly deposits in the bank amount 50, what is his monthly salary ?

(A) Rs.500

(B) Rs.1500

(C) Rs.1000

(D) Rs. 900

9. What is the difference between the two declaration ?

#include <stdio.h>

&

#include “stdio.h”

(A) No Difference

(B) The 2nd declaration will not compile

(C) First case Compiler looks in all default location and in 2nd case only in the working directory

(D) Depends on the Compiler

10. How can I print a “%” character in a in between the string foo and the value held in the variable foo using printf format string?

(A) fprintf(“foo ” “%” “%d\n”, foo);

(B) fprintf(“foo ‘%’ %d\n”, foo);

(C) fprintf(“foo \% %d\n”, foo);

(D) fprintf(“foo ” “%d\n”, foo);

11. What is the output of the following program

#include <stdio.h>

#define FIRST_PART 7

#define LAST_PART 5

#define ALL_PARTS FIRST_PART + LAST_PART

int main() {

printf (“The Square root of all parts is %d\n , ALL_PARTS * ALL_PARTS) ;

return(0);

}

(A) 35

(B) 144

(C) 49

(D) 47

12. What is the use of a make file

(A) Do detect memory leakage

(B) To optimise the code

(C) To link and compile source code to exe

(D) To disassemble the exe to source code

13. What is the difference between calloc and malloc

(A) calloc allocates memory in contiguous bytes, malloc does not ensure contiguous memory allocation

(B) Memory allocated through calloc need not be freed explicitly, While memory allocated through malloc needs to be freed explicitly.

(C) calloc initialises the memory by setting all-bits-zero, malloc does not does any zero fill.

(D) all of the above

14. What is the output :

void main()

{

int a,b=5,c=10;

a = (b-c) > (c-b) ? b : c;

printf(“%d”,a);

}

(A) 10

(B) 5

(C) 0

(D) Error

15. What is the value of *second_ptr

int *first_ptr;

int *second_ptr;

*second_ptr = 30;

ptr value = 1;

first_ptr = &value

second_ptr = first_ptr;

(A) 30

(B) 1

(C) first_ptr

(D) None of the above

16. How many columns are retrieved from this query:

SELECT address1||’,'||address2||’,'||address2 “Adress” FROM employee;

(A) 1

(B) 2

(C) 3

(D) 0

17. To produce a meaningful result set without any cartesian products, what is the minimum number of conditions that should appear in the WHERE clause of a four-table join?

(A) 8

(B) 3

(C) 4

(D) 5

18. Assuming today is Monday, 10 July 2000, what is returned by this statement:

SELECT to_char(NEXT_DAY(sysdate, ‘MONDAY’), ‘DD-MON-RR’) FROM dual;

(A) 10-JUL-00

(B) 12-JUL-00

(C) 11-JUL-00

(D) 17-JUL-00

19. Which character is used to continue a statement in SQL*Plus?

(A) *

(B) /

(C) -

(D) @

20. When a user creates an object without a TABLESPACE clause, where will Oracle store the segment?

(A) System tablespace

(B) Users tablespace

(C) Default tablespace for the user

(D) Oracle will give an error

21. The primary key on table EMP is the EMPNO column. Which of the following statements will not use the associated index on EMPNO?

(A) select * from EMP where nvl(EMPNO, ‘00000′) = ‘59384′;

(B) select * from EMP where EMPNO = ‘59384′;

(C) select EMPNO, LASTNAME from EMP where EMPNO = ‘59384′;

(D) select 1 from EMP where EMPNO = ‘59834′;

22. Which character function can be used to return a specified portion of a character string?

(A) INSTR

(B) SUBSTRING

(C) SUBSTR

(D) POS

23. Which command will delete all data from a table and will not write to the rollback segment?

(A) DROP

(B) DELETE

(C) CASCADE

(D) TRUNCATE

24. Which of the following can be a valid column name?

(A) Column

(B) 1966_Invoices

(C) Catch_#22

(D) #Invoices

25. Which Oracle access method is the fastest way for Oracle to retrieve a single row?

(A) Primary key access.

(B) Access via unique index

(C) Table access by ROWID

(D) Full table scan

26. In this PL/SQL statement, which of the following lines will produce an error?

(A) cursor CAPITALS is select CITY, STATE

(B) into my_city, my_state

(C) from CITIES

(D) where CAPITAL = ‘Y’;

27. In a PL/SQL block, a variable is declared as NUMBER without an initial value. What will its value be when it is used in the executable section of the PL/SQL block?

(A) NULL

(B) 0

(C) Results in a compilation error

(D) An exception will be raised

28. PL/SQL raises an exception, in which TWO of the following cases:

(A) When a SELECT statement returns one row

(B) When a SELECT statement returns more than one row

(C) When the datatypes of SELECT clause and INTO clause do not match

(D) When INTO statement is missing in the SELECT statement

29. What is the result if two NULL values are compared to each other?

(A) TRUE

(B) FALSE

(C) Undefined

(D) NULL

30. Functions for error trapping are contained in which section of a PL/SQL block?

(A) Header

(B) Declarative

(C) Executable

(D) Exception


1. To see current user name
Sql> show user;
2. Change SQL prompt name
SQL> set sqlprompt “Manimara > “
Manimara >
Manimara >
3. Switch to DOS prompt
SQL> host
4. How do I eliminate the duplicate rows ?
SQL> delete from table_name where rowid not in (select max(rowid) from table group by
duplicate_values_field_name);
or
SQL> delete duplicate_values_field_name dv from table_name ta where rowid <(select min(rowid) from
table_name tb where ta.dv=tb.dv);
Example.
Table Emp
Empno Ename
101 Scott
102 Jiyo
103 Millor
104 Jiyo
105 Smith
delete ename from emp a where rowid < ( select min(rowid) from emp b where a.ename = b.ename);
The output like,
Empno Ename
101 Scott
102 Millor
103 Jiyo
104 Smith
5. How do I display row number with records?
To achive this use rownum pseudocolumn with query, like SQL> SQL> select rownum, ename from emp;
Output:
1 Scott
2 Millor
3 Jiyo
4 Smith
6. Display the records between two range
select rownum, empno, ename from emp where rowid in
(select rowid from emp where rownum <=&upto
minus
select rowid from emp where rownum<&Start);
Enter value for upto: 10
Enter value for Start: 7
ROWNUM EMPNO ENAME
--------- --------- ----------
1 7782 CLARK
2 7788 SCOTT
3 7839 KING
4 7844 TURNER
7. I know the nvl function only allows the same data type(ie. number or char or date
Nvl(comm, 0)), if commission is null then the text “Not Applicable” want to display, instead of
blank space. How do I write the query?
SQL> select nvl(to_char(comm.),'NA') from emp;
Output :
NVL(TO_CHAR(COMM),'NA')
-----------------------
NA
300
500
NA
1400
NA
NA
8. Oracle cursor : Implicit & Explicit cursors
Oracle uses work areas called private SQL areas to create SQL statements.
PL/SQL construct to identify each and every work are used, is called as Cursor.
For SQL queries returning a single row, PL/SQL declares all implicit cursors.
For queries that returning more than one row, the cursor needs to be explicitly declared.
9. Explicit Cursor attributes
There are four cursor attributes used in Oracle
cursor_name%Found, cursor_name%NOTFOUND, cursor_name%ROWCOUNT, cursor_name%ISOPEN
10. Implicit Cursor attributes
Same as explicit cursor but prefixed by the word SQL
SQL%Found, SQL%NOTFOUND, SQL%ROWCOUNT, SQL%ISOPEN
Tips : 1. Here SQL%ISOPEN is false, because oracle automatically closed the implicit cursor after
executing SQL statements.
: 2. All are Boolean attributes.
11. Find out nth highest salary from emp table
SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B
WHERE a.sal<=b.sal);
Enter value for n: 2
SAL
---------
3700
12. To view installed Oracle version information
SQL> select banner from v$version;
13. Display the number value in Words
SQL> select sal, (to_char(to_date(sal,'j'), 'jsp'))
from emp;
the output like,
SAL (TO_CHAR(TO_DATE(SAL,'J'),'JSP'))
--------- -----------------------------------------------------
800 eight hundred
1600 one thousand six hundred
1250 one thousand two hundred fifty
If you want to add some text like,
Rs. Three Thousand only.
SQL> select sal "Salary ",
(' Rs. '|| (to_char(to_date(sal,'j'), 'Jsp'))|| ' only.'))
"Sal in Words" from emp
/
Salary Sal in Words
------- ------------------------------------------------------
800 Rs. Eight Hundred only.
1600 Rs. One Thousand Six Hundred only.
1250 Rs. One Thousand Two Hundred Fifty only.
14. Display Odd/ Even number of records
Odd number of records:
select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp);
1
3
5
Even number of records:
select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)
2
4
6
15. Which date function returns number value?
months_between
16. Any three PL/SQL Exceptions?
Too_many_rows, No_Data_Found, Value_Error, Zero_Error, Others
17. What are PL/SQL Cursor Exceptions?
Cursor_Already_Open, Invalid_Cursor
18. Other way to replace query result null value with a text
SQL> Set NULL ‘N/A’
to reset SQL> Set NULL ‘’
19. What are the more common pseudo-columns?
SYSDATE, USER , UID, CURVAL, NEXTVAL, ROWID, ROWNUM
20. What is the output of SIGN function?
1 for positive value,
0 for Zero,
-1 for Negative value.
21. What is the maximum number of triggers, can apply to a single table?
12 triggers.


Tags
placement

Quick Reply
Your Username: Click here to log in

Message:
Options

Thread Tools Search this Thread



All times are GMT +5. The time now is 11:50 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
SEO by vBSEO 3.6.0 PL2

1 2 3 4