Thursday, 10 July 2008
Oracle Exam Papers - September 26,2004 Paper - 27
*
It contains 30 Questions of SQL + PL/SQL and the TIME allocated is 30 minutes
*
After test (15 Mins.) a Oracle guy declared test results by announcing the full name of candidates and apologising to others. Very Polite.
*
Then another test for Programming is there.
*
After this they have to go for the round of Interviews.
Aptitude section of Oracle
1.
Two words are given by
Word 1: 83263641
Word 2: 3715468 ( don’t remember the order of the numbers.)
Each character is represented by a digit and each digit represents a character.
It is given that T and R occur four times. S and A occur two times. E, P, O and M occur one time each. The word
2.
starts with T. The letter E occurs in word one only. The questions were,
a). Which number represents T.
b). Which number represents S.
c). Which character represents 2.
d). Which digit represents A.
e). Which word represents word 2.
3.
There was a table with data related to net sales, gross profit, etc... and some questions were asked related to it. Very easy…
4.
A man spent 1/6th of his life in child hood, 1/12th of his life as youngster and 1/7th of his life as a bachelor. After five years of his marriage a son was born to him. The son died four years before the father died and at the time of his death his age was half the total age of his father.
The questions were,
a. What is the age of the father. (84)
b. At what age was he married.(33)
c. What is the age of his son.(42)
5.
Rita puts 9 pairs of black socks and 8 pairs of white socks in a drawer. She takes 3 socks. What is the probability that we get a pair of black socks.
6.
What is the value of the following series 1/7 + 2/72 + 1/73 +2/74 + 1/75 + ……….
7.
What should be the value of a, in the polynomials x2 – 11x + a and x2 – 14x + 2a, so that these two polynomials have common factors. a) 24 b)1 c)-1 d)1/2
8.
What is the sum of all the four digit numbers formed using the digits 0, 1, 2 and 3. None of the two digits should be repeated.
9.
a right angled triangle, the square of the hypotenuse is twice the product of the other two sides. Then one of the acute angles of the triangle is… a) 450 b) 300 c) 600 d) 150
10.
There are two square rooms. Both are of same height. The second room is 5m longer than the first room. The rate for papering the walls is 10 paisa per square meter. The total cost for papering the rooms is Rs 60 and Rs 80. What is the height of the rooms.
11.
There are two numbers in the ratio 8:9. if the smaller of the two numbers is increased by 12 and the larger number is reduced by 19 thee the ratio of the two numbers is 5:9.
Find the larger number.
12.
In class of 10 students, the teacher writes a number on the board. The first student tells that the number is divisible by 1, the second student tells that the number is divisible by 2, the third by 3, the forth by 4 and so on till 10. If the statement of one of the students in wrong then what is the least number possible.
13.
The first and the last sentences of a set of sentences are given. The middle four sentences are in jumbled form we have to select the order in which the sentences are to be placed so that they convey a meaningful message.
14.
A passage with two paragraphs is given. Then two questions are asked based on it. Could not remember it.
15.
A stamp collector arranges his stamps during his free time. When he arranges his stamps in pairs, there is one stamp left. It is the same when he arranges the stamps in groups of 3, 4, 5 and 6. Now, how many stamps will he be left with when he arranges them in groups of 8.
Technical
16.
Delete from table tempv where rowid in (select rowid from tempv where rowid in (((select min(rowid) from tempv where ... count(*) > 1))) union(select rowid from tempv where rowid in (((select min(rowid) from tempv where ... count(*) > 1)));
17.
When there is a failure in fetching the rows from a cursor...
a. %isopen
b. %notfound
c. %found
d. %rowcount
18.
Select ,oracle, from dual where null = null;
a. oracle
b. null
c. error out
d. no rows selected
19.
here is a question of Package body and Package Specification, they have provided the code for that describing the scenario of movie_tickets_sold and asked the programmer to insert a block of code...., where that code block to be inserted? In Package body? or in Package Specification?
20.
Which of the following operator is not used in Outer Join?
a. =
b. !=
c. AND
d. OR
21.
PL/SQL uses which of the following
a. Early Binding
b. Late binding
c. No Binding
d. Deferred Binging
22.
Following is a database trigger, CREATE OR REPLACE TRIGGER delete_row ON DELETE
not remember the complete question.
23.
If table contains 100 rows and it is truncated, how many rows get updated
a. 0
b. 1
c. 100
d. No rows updated
24.
There are some questions on Basic SELECT STATEMENTS...
25.
Some questions on Triggers, Procedures
26.
VARRAYS/Nesting of Table: 1 question is there
27.
NLS_DATE_FORMAT: 1 question
28.
The size of the float data type in C language is …
29.
he size of the float data type in C language is …
What is the output of the following C program.
Main()
{
printf(“%c”,”abcdefgh”[4]);
}
30.
What is the o/p of the following C-program.
Main()
{
char str[7]=”strings”;
printf(“%s”,str);
}
31.
main()
{
file *fp;
fp=fopen(“xyz”,”r”);
}
What does fp point to?
32.
What is the maximum no. of arguments that can be given in a command line in C.
33.
When the variables are pushed into the stack, which method is used to retrieve them from it.
a) pop b) pull c) remove d) none of these.
34.
What is the size of integer variable in JAVA?
35.
A programs reads “The man and the boy\r\n” from a file using fgets() and stores it in str[]. Then the string stored in str is
a) “The man and the boy\r\n\0”
b) “The man and the boy\r\0”
c) “The man and the boy\n\0”
d) “The man and the boy\0”
36.
After this written exam, we had another written for the short-listed students. It contained algorithms and coding. There were two questions.
37.
The first one was the conversion of a given expression into its postfix form and then to evaluate it.
38.
The question was to have a circularly linked link-list of integers 1 to n. I we give k as an input then we have to output(print) 1, k, 1+2k, 1+3k … till n and we have to delete these numbers. When we give then next k we have to continue the same process starting with 2. The linked needs to be maintained.
Oralce Exam - July 13 2003 Paper - 25
30 technical and 30 aptitude and 60 min time. Technical section: its very easy any one can answer 25
qns without preperation. some are
1. How compiler treats variables of recursive functions
2. What is orthogonal matrix?
3. Given two tables and asked 2 qns on those table ,
4 One is on join and another is on NOT IN
5. Given some qns on pointers( pretty easy)
6. Given five qns on data structures like , lifo, fifo
7. Qtn on primary key
8. How NULL in sql is treated?
9. Given a doubly linked list and asked r->left->right->data ans: r->data
10: Explain const char *ptr and char *const ptr
11 Remaining i didn`t remember
Technical
1. What is the output of the following program? office:office" "
#include
#include
void main( )
{
int a=5,b=7;
printf(“%d\n”,b\a);
}
A. 1.4
B. 1.0
C. 1
D. 0
2. What is the output of the following program listing?
#include
void main ( )
{
int x,y:
y=5;
x=func(y++);
printf(“%s\n”,
(x==5)?”true”;”false”);
}
int func(int z)
{ if (z== 6)
return 5;
else
return 6;}
A True
B false
C either a or b
D neither a nor b
3. What is the output of the following progarm?
#include
main( )
{
x=4;
y=fact(x);
printf(“%d\n”,y);
}
unsigned int fact(int x)
{ return(x*fact(x-1));}
A. 24
B. 10
C. 4
D. none
4. Consider the following C program and chose collect answer
#include
void main( )
{
inta[10],k;
for(k=0;k<10;k++)
{ a[k]=k;}
printf (“%d\n”,k);
}
A. value of k is undefined ; unpredictable answer
B. 10
C. program terminates with run time error
D. 0
5. Consider the prog and select answer
#include
void main ( )
{
int k=4,j=0:
switch (k)
{ case 3: j=300;
case 4:
case 5: j=500;
}
printf (“%d\n”,j);
}
A. 300
B. 400
C. 500
D. 0
6. Consider the following statements:
Statement 1 A union is an object consisting of a sequence of named members of various types
Statement 2 A structure is a object that contains at different times, any one of the several members of
various types
Statement 3: C is a compiled as well as an interpretted language
Statement 4: It is impossible to declare a structure or union containing an instance of itself
A. all the statements are correct
B. except 4 all are correct
C. statemnt 3 is only correct
D. statement 1,3 are incorrect either 2 or 4 is correct
7. consider the following program listing and select the output
#include
main ( )
{
int a=010,sum=0,tracker:
for(tracker=0;tracker<=a;tracker++)
sum+=tracker;
printf(“ %d\n”,sum);}
A. 55
B. 36
C. 28
D. n
8.Spot the line numbers , that are valid according to the ANSI C standards?
Line 1: #include
Line 2: void main()
Line 3: {
4 : int *pia,ia;
5 :float *pafa,fa;
6 :ia=100;
7 :fa=12.05;
8 :*pfa=&ia;
9 :pfa=&ia;
10 :pia=pfa;
11 :fa=(float)*pia;
12 :fa=ia;
13 :}
a. 8 and 9
b. 9 and 10
c. 8 and 10
d. 10 and 11
8. What is the o/p of the follow pgm?
#include
main()
{
char char_arr[5]=”ORACL”;
char c=’E’;
prinf(“%s\n”,strcat(char_arr,c));
}
a:oracle
b. oracl
c.e
d.none
9. consider the following pgm listing
#include
main()
{
int a[3];
int *I;
a[0]=100;a[1]=200;a[2]=300;
I=a;
Printf(“%d\n”, ++*I);
Printf(“%d\n”, *++I);
Printf(“%d\n”, (*I)--);
Printf(“%d\n”, *I);
}
what is the o/p
a. 101,200,200,199
b. 200,201,201,100
c. 101,200,199,199
d. 200,300,200,100
10. which of the following correctly declares “My_var” as a pointer to a function that returns an integer
a. int*My_Var();
b. int*(My_Var());
c. int(*)My_Var();
d. int(*My_Var)();
11. what is the memory structure employed by recursive functions in a C pgm?
a. B tree
b. Hash table
c. Circular list
d. Stack
12. Consider the follow pgm listing?
Line 1: #include
2: void main()
3: {
4: int a=1;
5: const int c=2;
6: const int *p1=&c;
7: const int*p2=&a;
8: int *p3=&c;
9: int*p4=&a;
10:}what are the lines that cause compilation errors?
a.7
b.8
c.6 and 7
d.no errors
13. what will be the o/p
#include
main()
{
inta[3];
int *x;
int*y;
a[0]=0;a[1]=1;a[2]=2;
x=a++;
y=a;
printf(“%d %d\n”, x,(++y));
}
a. 0,1
b. 1,1
c. error
d. 1,2
what is the procedure for swapping a,b(assume that a,b and tmp are of the same type?
a. tmp=a; a=b;b=temp;
b. a=a+b;b=a-b;a=a-b;
c. a=a-b;b=a+b;a=b-a;
d. all of the above
Campus Interview Conducted in Surathkal on 11th July -2003
Test was of 1 hour 30 questions. g aptitude and 30 of technical.......some questions. of g aptitude were very
lengthy so don,t end up in solving them.....time was less......some 15 questions. from arithmetic......and rest 15
logical,statement interpretation,arrangement,tense correction......and like that......
1. Given a square matrix which consists only of 1 and 0......find which rows,which cols and which diagonals
consist entirely of 1,s.
2. Given an array of integers find all possible combinations of the numbers whose sum equal to 90.....
ans : knapsack problem (in data structures - aho ullman)
Note : for them solution was not the criteria.......but the approach was important......the solution should
be generalised and optimized........optimization was given the top priority........
Techincal paper
1. const int MAX=10;
main()
{
enum a {a,b,MAX};
print MAX;
}
ans. 2
2. enum variable is a const variable which can only be assigned a value at initialization or a non const variable which
can be assigned any value in the middle of the program?
ans. const variable
3. void *p; what operation cannot be performed on p?
ans : arithmetic operation unless it is properly typecasted
4. char **p="Hello";
print p,*p,**p
ans. Hello (null)
warning: suspicious pointer conversion
5. main()
{
char str[]="Geneius";
print (str);
}
print(char *s)
{ if(*s)
print(++s);
printf("%c",*s);
}
ans. suiene
6. what does the function fcloseall() does ?
ans. fcloseall() closes all open streams except stdin,stdout,stderr,stdprn and stdaux
7. main()
{
printf("Genius %d",fun(123));
}
fun(int n)
{
return (printf("%d",n));
}
ans. 123genius3
8. difference between definition and declaration. ans. definition once while declaration more than once
9. find the error?
main()
{ void fun();
fun();
}
void fun()
{
int i=10;
if(i<10)
return 2.0;
return 3.0;
}
ans. no error but warning
10. int a=9,b=5,c=3,d;
d=(b-c)<(c-a) ? a : b;
print d
ans 5
11. 1+2/3*4+1=? Ans. 2
12. In C++, a variable can be defined wherever needed whereas not in C
13. main()
{
int i=4;
fun(i=i/4);
print i;
}
fun(int i)
{
return i/2;
}
ans 1
14. what is an array ?
ans. contiguous collection of memory occupied by similar data types
15. printf("\"NITK %%SURAHKAL%% !\"");
ans. "NITK %SURATHKAL% !"
16. difference between scanf and gets in case of string input
ans. scanf does not accepts white space while gets does
17. table t1 m rows and x cols table t2 n rows and y cols
in t1*t2 rows? cols=?
ans. m*n ,x+y
18. symbol of realtionship between 2 entities?
19. which one cannot come in data modelling
a. customer b. student c. office d. speed
ans speed
20. can a database table exist without a primary key ?
21. whether higher normal forms better than lower forms as far redundancy is concerned ?
ans. higher
22. file is at which level
ans. conceptual level
ans. primary key in some other table
Oracle Papers Paper - 26
2. Programming written ( main theme is to test our data structure knowledge, proficiency
sorting searching algorithms will clear this round )
3. Technical interview
4. Puzzle solving
Friends if u clear all this four rounds u are ready for ORACLE.
SQL AND SQL*Plus
-
Which of the following statements contains an error?
a.. SELECT * FROM emp WHERE empid = 493945;
b. SELECT empid FROM emp WHERE empid= 493945;
c. SELECT empid FROM emp;
d. SELECT empid WHERE empid = 56949 AND lastname = ,SMITH,; -
Which of the following correctly describes how to specify a column alias?
a. Place the alias at the beginning of the statement to describe the table.
b. Place the alias after each column, separated by white space, to describe the column.
c. Place the alias after each column, separated by a comma, to describe the column.
d. Place the alias at the end of the statement to describe the table. -
The NVL function
a. Assists in the distribution of output across multiple columns.
b. Allows the user to specify alternate output for non-null column values.
c. Allows the user to specify alternate output for null column values.
d Nullifies the value of the column output -
Output from a table called PLAYS with two columns, PLAY_NAME and AUTHOR,is shown below.Which of the following SQL statements produced it?
PLAY_TABLE
"Midsummer Night,s Dream", SHAKESPEARE
"Waiting For Godot", BECKETT
"The Glass Menagerie", WILLIAMSa SELECT play_name || author FROM plays;
b SELECT play_name, author FROM plays;
c SELECT play_name||,, , || author FROM plays;d SELECT play_name||,, , || author PLAY_TABLE FROM plays;
-
Issuing the DEFINE_EDITOR="emacs" will produce which outcome?
a. The emacs editor will become the SQL*Plus default text editor.
b. The emacs editor will start running immediately.
c. The emacs editor will no longer be used by SQL*Plus as the default text editor.
d. The emacs editor will be deleted from the system. -
The user issues the following statement. What will be displayed if the EMPID selected is 60494? SELECT DECODE(empid,38475, "Terminated",60494, "LOA", "ACTIVE")FROM emp;
a. 60494
b. LOA
c. Terminatedd. ACTIVE -
SELECT (TO_CHAR(NVL(SQRT(59483), "INVALID")) FROM DUAL is a valid SQL statement.
a. TRUE
b. FALSE -
The appropriate table to use when performing arithmetic calculations on values defined within the SELECT statement (not pulled from a table column) is
a. EMP
b. The table containing the column values
c. DUALD. An Oracle-defined table -
Which of the following is not a group function?
a. avg( )
c. sqrt( )
c. sum( )
d. max( ) -
Once defined, how long will a variable remain so in SQL*Plus?
a. Until the database is shut down
b. Until the instance is shut down
c. Until the statement completes
d. Until the session completes -
The default character for specifying runtime variables in SELECT statements is
a. Ampersand
b. Ellipses
c. Quotation marks
d. Asterisk -
A user is setting up a join operation between tables EMP and DEPT. There are some employees in the EMP table that the user wants returned by the query, but the employees are not assigned to departments yet. Which SELECT statement is most appropriate for this user?
a. select e.empid, d.head from emp e, dept d;
b. Select e.empid, d.head from emp e, dept d where e.dept# = d.dept#;
c. Select e.empid, d.head from emp e, dept d where e.dept# = d.dept# (+);
d. Select e.empid, d.head from emp e, dept d where e.dept# (+) = d.dept#; -
Developer ANJU executes the following statement: CREATE TABLE animals AS SELECT * fromMASTER.ANIMALS; What is the effect of this statement?
a. A table named ANIMALS will be created in the MASTER schema with the same data as the ANIMALS table owned by ANJU
b. A table named ANJU will be created in the ANIMALS schema with the same data as the ANIMALS table owned by MASTER
c. A table named ANIMALS will be created in the ANJU schema with the same data as the ANIMALS table owned by MASTER.
d. A table named MASTER will be created in the ANIMALS schema with the same data as the ANJU table owned by ANIMALS. -
User JANKO would like to insert a row into the EMPLOYEE table, which has three columns: EMPID,LASTNAME, and SALARY. The user would like to enter data for EMPID 59694, LASTNAME Harris, but no salary. Which statement would work best?
a. INSERT INTO employee VALUES (59694,,HARRIS,, NULL);
b. INSERT INTO employee VALUES (59694,,HARRIS,);
c. INSERT INTO employee (EMPID, LASTNAME, SALARY) VALUES (59694,,HARRIS,);
d. INSERT INTO employee (SELECT 59694 FROM ,HARRIS,); -
Which three of the following are valid database datatypes in Oracle? (Choose three.)
a. CHAR
b. VARCHAR2
c. BOOLEAN
d. NUMBER -
Omitting the WHERE clause from a DELETE statement has which of the following effects?
a. The delete statement will fail because there are no records to delete.
b. The delete statement will prompt the user to enter criteria for the deletion
c. The delete statement will fail because of syntax error.
d. The delete statement will remove all records from the table. -
Creating a foreign-key constraint between columns of two tables defined with two different datatypes will produce an error.
a. TRUE
b. FALSE -
Dropping a table has which of the following effects on a nonunique index created for the table?
a. No effect.
b. The index will be dropped.
c. The index will be rendered invalid.
d. The index will contain NULL values. -
To increase the number of nullable columns for a table,
a. Use the alter table statement.
b. Ensure that all column values are NULL for all rows.
c. First increase the size of adjacent column datatypes, then add the column.
d. Add the column, populate the column, then add the NOT NULL constraint. -
Which line of the following statement will produce an error?
a. CREATE TABLE goods
b. (good_no NUMBER,
c. good_name VARCHAR2 check(good_name in (SELECT name FROM avail_goods)),
d. CONSTRAINT pk_goods_01
e. PRIMARY KEY (goodno));
f. There are no errors in this statement. -
MAXVALUE is a valid parameter for sequence creation.
a. TRUE
b. FALSE -
Which of the following lines in the SELECT statement below contain an error?
a SELECT DECODE(empid, 58385, "INACTIVE", "ACTIVE") empid
b. FROM emp
c. WHERE SUBSTR(lastname,1,1) > TO_NUMBER(,S,)
d. AND empid > 02000
e. ORDER BY empid DESC, lastname ASC;
f. There are no errors in this statement. -
Which function below can best be categorized as similar in function to an IF-THEN-ELSE statement?
a. SQRT
b. DECODE
c. NEW_TIME
d. ROWIDTOCHAR -
Which two of the following orders are used in ORDER BY clauses? (choose two)
a. ABS
b. ASC
c. DESC
d. DISC -
You query the database with this command SELECT name FROM employee WHERE name LIKE ‘_a%’; Which names are displayed?
a. Names starting with “a”
b. Names starting with “a” or “A”
c. Names containing “a” as second character
d. Names containing “a” as any letter except the firs
PL/SQL -
Which of the following statements is true about implicit cursors?
a. Implicit cursors are used for SQL statements that are not named.
b. Developers should use implicit cursors with great care.
c. Implicit cursors are used in cursor for loops to handle data processing.
d. Implicit cursors are no longer a feature in Oracle. -
Which of the following is not a feature of a cursor FOR loop?
a. Record type declaration.
b. Opening and parsing of SQL statements.
c. Fetches records from cursor.
d. Requires exit condition to be defined. -
A developer would like to use referential datatype declaration on a variable. The variable name is EMPLOYEE_LASTNAME, and the corresponding table and column is EMPLOYEE, and LNAME, respectively. How would the developer define this variable using referential datatypes?
a. Use employee.lname%type.
b. Use employee.lname%rowtype.
c. Look up datatype for EMPLOYEE column on LASTNAME table and use that.
d. Declare it to be type LONG. -
Which three of the following are implicit cursor attributes?
a. %found
b. %too_many_rows
c. %notfound
d. %rowcount
e. %rowtype -
If left out, which of the following would cause an infinite loop to occur in a simple loop?
a. LOOP
b. END LOOP
c. IF-THEN
d. EXIT -
Which line in the following statement will produce an error?
a. cursor action_cursor is
b. select name, rate, action
c. into action_record
d. from action_table;
e. There are no errors in this statement. -
The command used to open a CURSOR FOR loop is
a. open
b. fetch
c. parse
d. None, cursor for loops handle cursor opening implicitly -
What happens when rows are found using a FETCH statement
a. It causes the cursor to close
b. It causes the cursor to open
c. It loads the current row values into variables
d. It creates the variables to hold the current row values -
CREATE OR REPLACE PROCEDURE find_cpt (v_movie_id {ArgumentMode}NUMBER, v_cost_per_ticket {argument mode} NUMBER)IS
BEGIN
IF v_cost_per_ticket > 8.5 THEN
SELECT cost_per_ticket
INTO v_cost_per_ticket
FROM gross_receipt
WHERE movie_id = v_movie_id;
END IF;
END;
Which mode should be used for V_COST_PER_TICKET?
a. IN
b. OUT
c. RETURN
d. IN OUT -
CREATE OR REPLACE TRIGGER update_show_gross {trigger information}
BEGIN
{additional code}
END;
The trigger code should only execute when the column, COST_PER_TICKET, is greater than $3.75. Which trigger information will you add?
a. WHEN (new.cost_per_ticket > 3.75)
b. WHEN (:new.cost_per_ticket > 3.75
c. WHERE (new.cost_per_ticket > 3.75)
d.
Oralce Exam - 11th July -2003 Paper - 24
Campus Interview Conducted in Surathkal on 11th July -2003
Test was of 1 hour 30 questions. g aptitude and 30 of technical.......some questions. of aptitude
were very lengthy so don,t end up in solving them.....time was less......some 15 questions. from
arithmetic......and rest 15 logical,statement interpretation,arrangement,tense correction......and
like that......
-
Given a square matrix which consists only of 1 and 0......find which rows,which cols and which diagonals consist entirely of 1,s.
-
Given an array of integers find all possible combinations of the numbers whose sum equal to 90.....
ans : knapsack problem (in data structures - aho ullman)
Note : for them solution was not the criteria.......but the approach was important......the solution
should be generalised and optimized........optimization was given the top priority........
Technical Papers
-
const int MAX=10;
main()
{
enum a {a,b,MAX};
print MAX;
}
ans. 2 -
enum variable is a const variable which can only be assigned a value at initialization or a non const variable which can be assigned any value in the middle of the program?
ans. const variable -
void *p; what operation cannot be performed on p? ans : arithmetic operation unless it is properly typecasted
-
char **p="Hello";
print p,*p,**p
ans. Hello (null)
warning: suspicious pointer conversion -
main()
{
char str[]="Geneius";
print (str);
}
print(char *s)
{
if(*s)
print(++s);
printf("%c",*s);
}
ans. suiene -
what does the function fcloseall() does ?
ans. fcloseall() closes all open streams except stdin,stdout,stderr,stdprn and stdaux -
main()
{
printf("Genius %d",fun(123));
}
fun(int n)
{
return (printf("%d",n));
}
ans. 123genius3 -
difference between definition and declaration. ans. definition once while declaration more than once
-
find the error?
main()
{
void fun();
fun();
}
void fun()
{
int i=10;
if(i<10)
return 2.0;
return 3.0;
}
ans. no error but warning -
int a=9,b=5,c=3,d;
d=(b-c)<(c-a) ? a : b;
print d
ans 5 -
1+2/3*4+1=? Ans. 2
-
In C++, a variable can be defined wherever needed whereas not in C
-
main()
{
int i=4;
fun(i=i/4);
print i;
}
fun(int i)
{
return i/2;
}
ans 1 -
what is an array ?
ans. contiguous collection of memory occupied by similar data types -
printf("\"NITK %%SURAHKAL%% !\"");
ans. "NITK %SURATHKAL% !" -
difference between scanf and gets in case of string input ans. scanf does not accepts white space while gets does
-
table t1 m rows and x cols table t2 n rows and y cols
in t1*t2 rows? cols=?
ans. m*n ,x+y -
symbol of realtionship between 2 entities?
-
which one cannot come in data modelling a. customer b. student c. office d. speed ans speed
-
can a database table exist without a primary key ?
-
whether higher normal forms better than lower forms as far redundancy is concerned ? ans. higher
-
file is at which level ans. conceptual level
-
what is a foreign key ans. primary key in some other table
Oracle Exam Model Paper Paper - 22
(A) Cindy (B) Amy (C) Linda (D) None of these
2. Two twins have certain peculiar characteristics. One of them always lies on Monday, Wednesday, Friday. The other always lies on Tuesdays, Thursday and Saturdays. On the other days they tell the truth. You are given a conversation.
Person A- today is Sunday, my name is Anil
Person B-today is Tuesday, my name is Bill What day is today?
(A) Sunday (B) Tuesday (C) Monday (D) Thursday
3. The difference of a number and its reciprocal is 1/2.The sum of their squares is
(A) 9/4 (B) 4/5 (C) 5/3 (D) 7/4
4. The difference of a number and its square is 870.What is the number?
(A) 42 (B) 29 (C) 30 (D) 32
5. A trader has 100 Kg of wheat, part of which he sells at 5% profit and the rest at 20% profit. He gains 15% on the whole. Find how much is sold at 5% profit?
(A) 60 (B) 50 (C) 66.66 (D) 33.3
6. Which of the following points are collinear?
(A) (3,5) (4,6) (2,7) (B) (3,5) (4,7) (2,3)
(C) (4,5) (4,6) (2,7) (D) (6,7) (7,8) (2,7)
7. A man leaves office daily at 7pm.a driver with car comes from his home to pick him from office and bring back home. One day he gets free at 5.30 and instead of waiting for driver he starts walking towards home. In the way he meets the car and returns home on car. He reaches home 20 minutes earlier than usual. In how much time does the man reach home usually?
(A) 1 hr 20 min (B) 1 hr (C) 1 hr 10 min (D) 55 min
8. If m:n = 2:3,the value of 3m+5n/6m-n is
(A) 7/3 (B) 3/7 (C) 5/3 (D) 3/5
9. A dog taken four leaps for every five leaps of hare but three leaps of the dog is equal to four leaps of the hare. Compare speed?
(A) 12:16 (B) 19:20 (C) 16:15 (D) 10:12
10. A watch ticks 90 times in 95 seconds. And another watch ticks 315 times in 323 secs. If they start together, how many times will they tick together in first hour?
(A) 100 times (B) 101 times (C) 99 times (D) 102 times
11. The purpose of defining an index is
(A) Enhance Sorting Performance (B) Enhance Searching Performance
(C) Achieve Normalization (D) All of the above
12. A transaction does not necessarily need to be
(A) Consistent (B) Repeatable (C) Atomic (D) Isolated
13. To group users based on common access permission one should use
(A) User Groups (B) Roles (C) Grants (D) None of the above
14. PL/SQL uses which of the following
(A) No Binding (B) Early Binding (C) Late Binding (D) Deferred Binding
15. Which of the constraint can be defined at the table level as well as at the column level
(A) Unique (B) Not Null (C) Check (D) All the above
16. To change the default date format in a SQLPLUS Session you have to
(A) Set the new format in the DATE_FORMAT key in the windows Registry.
(B) Alter session to set NLS_DATE-FORMAT.
(C) Change the Config.ora File for the date base.
(D) Change the User Profile USER-DATE-FORMAT.
17. Which of the following is not necessarily an advantages of using a package rather than independent stored procedure in data base.
(A) Better performance. (B) Optimized memory usage.
(C) Simplified Security implementation. (D) Encapsulation.
18. Integrity constrains are not checked at the time of
(A) DCL Statements. (B) DML Statements.
(C) DDL Statements. (D) It is checked all the above cases.
19. Roll Back segment is not used in case of a
(A) DCL Statements. (B) DML Statements. (C) DDL Statements. (D) all of the above.
20. An Arc relationship is applicable when
(A) One child table has multiple parent relation, but for anyone instance of a child record only one of the relations is applicable.
(B) One column of a table is related to another column of the same table.
(C) A child table is dependent on columns other than the primary key columns of the parent table.
(D) None of the above.
21. What is true about the following C functions?
(A) Need not return any value. (B) Should always return an integer.
(C) Should always return a float. (D) Should always return more than one value.
22. enum number { a=-1, b=4, c,d,e,} what is the value of e?
(A) 7 (B) 4 (C) 5 (D) 3
23. Which of the following about automatic variables within a function is correct?
(A) Its type must be declared before using the variable. (B) They are local.
(C) They are not initialized to zero. (D) They are global.
24. Consider the following program segment
int n, sum=5;
switch(n)
{
case 2:sum=sum-2;
case 3:sum*=5;
break;
default:sum=0;
}
if n=2, what is the value of the sum?
(A) 0 (B) 15 (C) 3 (D) None of these.
25. Which of the following is not an infinite loop?
(A) x=0; (B) # define TRUE 0....
do{ While(TRUE){....}
/*x unaltered within the loop*/ (C) for(;;) {....}
....}
While(x==0); (D) While(1) {....}
26. Output of the following program is
main()
{
int i=0;
for(i=0;i<20;i++)
{
switch(i){
case 0:
i+=5;
case 1:
i+=2;
case 5:
i+=5;
default:
i+=4;
break;
}
}
}
(A) 5,9,13,17 (B) 12,17,22 (C) 16,21 (D) syntax error.
27. What does the following function print?
func(int i)
{
if(i%2) return 0;
else return 1;
}
main()
{
int i=3;
i=func(i);
i=func(i);
printf("%d",i);
}
(A) 3 (B) 1 (C) 0 (D) 2
28. What will be the result of the following program?
char*g()
{
static char x[1024];
return x;
}
main()
{
char*g1="First String";
strcpy(g(),g1);
g1=g();
strcpy(g1,"Second String");
printf("Answer is:%s", g());
}
(A) Answer is: First String (B) Answer is: Second String
(C) Run time Error/Core Dump (D) None of these
29. Consider the following program
main()
{
int a[5]={1,3,6,7,0};
int *b;
b=&a[2];
}
The value of b[-1] is
(A) 1 (B) 3 (C) -6 (D) none
30. Given a piece of code
int x[10];
int *ab;
ab=x;
To access the 6th element of the array which of the following is incorrect?
(A) *(x+5) (B) x[5] (C) ab[5] (D) *(*ab+5} .
This is the oracle paper held on July 13 2003 at NITK Surathkal.
The test has 2 sections : 30 technical and 30 aptitude and 60 min time.
Technical section:
its very easy any one can answer 25 qns without preperation. some are
1. how compiler treats variables of recursive functions
2. what is orthogonal matrix?
3. given two tables and asked 2 qns on those table ,
one is on join and another is on NOT IN
4. given some qns on pointers( pretty easy)
5. given five qns on data structures like , lifo, fifo
6. qtn on primary key
7. how NULL in sql is treated?
8. given a doubly linked list and asked r->left->right->data
ans: r->data
9:explain const char *ptr and char *const ptr
remaining i didn`t remember
aptiude
15 quant apti from rs agrval
15 verbal apti,
in this 4 are odd word out
and 4 are sentese ordering when jumbled senteses given
and 4 are reasoning
Model Questions From the Exam conducted by Oracle Bangalore in 2002.
1. What is the output of the following program?
#include
#include
void main( )
{
int a=5,b=7;
printf(“%d\n”,b\a);
}
A. 1.4
B. 1.0
C. 1
D. 0
2. What is the output of the following program listing?
#include
void main ( )
{
int x,y:
y=5;
x=func(y++);
printf(“%s\n”,
(x==5)?”true”;”false”);
}
int func(int z)
{
if (z== 6)
return 5;
else
return 6;
}
A True
B false
C either a or b
D neither a nor b
3. What is the output of the following progarm?
#include
main( )
{
int x,y=10;
x=4;
y=fact(x);
printf(“%d\n”,y);
}
unsigned int fact(int x)
{
return(x*fact(x-1));
}
A. 24
B. 10
C. 4
D. none
4. Consider the following C program and chose collect answer
#include
void main( )
{
inta[10],k;
for(k=0;k<10;k++)
{
a[k]=k;
}
printf (“%d\n”,k);
}
A. value of k is undefined ; unpredictable answer
B. 10
C. program terminates with run time error
D. 0
5. Consider the prog and select answer
#include
void main ( )
{
int k=4,j=0:
switch (k)
{
case 3;
j=300;
case 4:
j=400:
case 5:
j=500;
}
printf (“%d\n”,j);
}
A. 300
B. 400
C. 500
D. 0
6. Consider the following statements:
Statement 1
A union is an object consisting of a sequence of named members of various types
Statement 2
A structure is a object that contains at different times, any one of the several members of various types
Statement 3
C is a compiled as well as an interpretted language
Statement 4
It is impossible to declare a structure or union containing an instance of itself
A. all the statements are correct
B. except 4 all are correct
C. statemnt 3 is only correct
D. statement 1,3 are incorrect either 2 or 4 is correct
7. consider the following program listing and select the output
#include
main ( )
{
int a=010,sum=0,tracker:
for(tracker=0;tracker<=a;tracker++)
sum+=tracker;
printf(“ %d\n”,sum);
}
A. 55
B. 36
C. 28
D. n
8.Spot the line numbers , that are valid according to the ANSI C standards?
Line 1: #include
Line 2: void main()
Line 3: {
4 : int *pia,ia;
5 :float *pafa,fa;
6 :ia=100;
7 :fa=12.05;
8 :*pfa=&ia;
9 :pfa=&ia;
10 :pia=pfa;
11 :fa=(float)*pia;
12 :fa=ia;
13 :}
a. 8 and 9
b. 9 and 10
c. 8 and 10
d. 10 and 11
8. What is the o/p of the follow pgm?
#include
main()
{
char char_arr[5]=”ORACL”;
char c=’E’;
prinf(“%s\n”,strcat(char_arr,c));
}
a:oracle
b. oracl
c.e
d.none
9. consider the following pgm listing
#include
main()
{
int a[3];
int *I;
a[0]=100;a[1]=200;a[2]=300;
I=a;
Printf(“%d\n”, ++*I);
Printf(“%d\n”, *++I);
Printf(“%d\n”, (*I)--);
Printf(“%d\n”, *I);
}
what is the o/p
a. 101,200,200,199
b. 200,201,201,100
c. 101,200,199,199
d. 200,300,200,100
10. which of the following correctly declares “My_var” as a pointer to a function that returns an integer
a. int*My_Var();
b. int*(My_Var());
c. int(*)My_Var();
d. int(*My_Var)();
11. what is the memory structure employed by recursive functions in a C pgm?
a. B tree
b. Hash table
c. Circular list
d. Stack
12. Consider the follow pgm listing?
Line 1: #include
2: void main()
3: {
4: int a=1;
5: const int c=2;
6: const int *p1=&c;
7: const int*p2=&a;
8: int *p3=&c;
9: int*p4=&a;
10:}
what are the lines that cause compilation errors?
a.7
b.8
c.6 and 7
d.no errors
13. what will be the o/p
#include
main()
{
inta[3];
int *x;
int*y;
a[0]=0;a[1]=1;a[2]=2;
x=a++;
y=a;
printf(“%d %d\n”, x,(++y));
}
a. 0,1
b. 1,1
c. error
d. 1,2
what is the procedure for swapping a,b(assume that a,b and tmp are of the same type?
a. tmp=a; a=b;b=temp;
b. a=a+b;b=a-b;a=a-b;
c. a=a-b;b=a+b;a=b-a;
d. all of the above
Oracle Exam in 2003 Paper - 23
| Oracle DBA Questions 1. SNAPSHOT is used for [DBA] 2. We can create SNAPSHOTLOG for[DBA] 4. ENQUEUE resources parameter information is derived from[DBA] 5. LGWR process writes information into 6. SET TRANSACTION USE ROLLBACK SEGMENT is used to create user 7. Databases overall structure is maintained in a file called 8. These following parameters are optional in init.ora parameter file DB_BLOCK_SIZE, PROCESSES 9. Constraints cannot be exported through EXPORT command 10. It is very difficult to grant and manage common privileges needed by different groups of database users 11. What is difference between a DIALOG WINDOW and a DOCUMENT WINDOW regarding 12 . What is the difference between a MESSAGEBOX and an ALERT 13. Which of the following is not an reason for the fact that most of the processing is done at the server ? 14. Can a DIALOG WINDOW have scroll bar attached to it ? 15. Which of the following is not an advantage of GUI systems ? 16. What is the difference between a LIST BOX and a COMBO BOX ? 17. In a CLIENT/SERVER environment , which of the following would not be done at the client ? 18. Why is it better to use an INTEGRITY CONSTRAINT to validate data in a table than to use a STORED 19. Which of the following is not an advantage of a client/server model ? 20. What does DLL stands for ? 21. POST-BLOCK trigger is a 22. The system variable that records the select statement that SQL * FORMS most recently used 23. Which of the following is TRUE for the ENFORCE KEY field 24. What is the maximum size of the page ? 25. A FORM is madeup of which of the following objects 26. For the following statements which is true 27. The packaged procedure that makes data in form permanent in the Database is 28. Which of the following is TRUE for the SYSTEM VARIABLE $date$ 9. Which of the following packaged procedure is UNRESTRICTED ? 30. Identify the RESTRICTED packaged procedure from the following 31. What is SQL*FORMS 32. Name the two files that are created when you generate a form using Forms 3.0 33. What is a trigger 34. Which of the folowing is TRUE for a ERASE packaged procedure 35. All datafiles related to a Tablespace are removed when the Tablespace is dropped 36. Size of Tablespace can be increased by 37 . Multiple Tablespaces can share a single datafile 38 . A set of Dictionary tables are created 39. Datadictionary can span across multiple Tablespaces 40. What is a DATABLOCK 41. Can an Integrity Constraint be enforced on a table if some existing table data does not satisfy the constraint 42. A column defined as PRIMARY KEY can have NULL,s 43. A Transaction ends 44. A Database Procedure is stored in the Database 45. A database trigger doesnot apply to data loaded before the definition of the trigger 46. Dedicated server configuration is 47. Which of the following does not affect the size of the SGA 48. What does a COMMIT statement do to a CURSOR 49. Which of the following is TRUE 50. Which of the following is NOT VALID is PL/SQL 51. Declare What will be the value of svar after the execution ? 52. Which of the following is not correct about an Exception ? 53. Which of the following is not correct about User_Defined Exceptions ? 54. A Stored Procedure is a 55. Which of the following statement is false 56. Is it possible to open a cursor which is in a Package in another procedure ? 57. Is it possible to use Transactional control statements in Database Triggers? 58. Is it possible to Enable or Disable a Database trigger ? 59. PL/SQL supports datatype(s) 60. Find the ODD datatype out 61. Which of the following is not correct about the "TABLE" datatype ? 62. Find the ODD one out of the following 63. Which of the following is not correct about Cursor ? 64. Which of the following is NOT VALID in PL/SQL ? 65. What is the Result of the following ,VIK,||NULL||,RAM, ? 66. Declare 67. Does the Database trigger will fire when the table is TRUNCATED ? 68. SUBSTR(SQUARE ANS ALWAYS WORK HARD,14,6) will return 69. REPLACE(,JACK AND JUE,,,J,,,BL,) will return 70. TRANSLATE(,333SQD234,,,0123456789ABCDPQRST,,,0123456789,) will return 71. EMPNO ENAME SAL Select SAL from EMP E1 where 3 > ( Select count(*) from Emp E2 where E1.SAL > E2.SAL ) will retrieve 72. Is it possible to modify a Datatype of a column when column contains data ? 73. Which of the following is not correct about a View ? 74. Which is not part of the Data Definiton Language ? 75. The Data Manipulation Language statements are 76. EMPNO ENAME SAL 77. If an UNIQUE KEY constraint on DATE column is created, will it accept the rows that are inserted with 78. What are the different events in Triggers ? 79. What built-in subprogram is used to manipulate images in image items ? 80. Can we pass RECORD GROUP between FORMS ? 81. SHOW_ALERT function returns 82. What SYSTEM VARIABLE is used to refer DATABASE TIME ? 83. :SYSTEM.EFFECTIVE.DATE varaible is 84. How can you CALL Reports from Forms4.0 ? 85. When do you get a .PLL extension ? 86. What is built_in Subprogram ? 87. GET_BLOCK property is a 88. A CONTROL BLOCK can sometimes refer to a BASETABLE ? 89. What do you mean by CHECK BOX ? 90. List of Values (LOV) supports 91. What is Library in Forms 4.0 ? 92. Can we use a RESTRICTED packaged procedure in WHEN_TEXT_ITEM trigger ? 93. Can we use GO_BLOCK package in a PRE_TEXT_ITEM trigger ? 94. What type of file is used for porting Forms 4.5 applications to various platforms ? 95. What built_in procedure is used to get IMAGES in Forms 4.5 ? 96. When a form is invoked with CALL_FORM does Oracle forms issues SAVEPOINT ? 97. Can we attach the same LOV to different fields in Design time ? 98. How do you pass values from one form to another form ? 99. Can you copy the PROGRAM UNIT into an Object group ? 100. Can MULTIPLE DOCUMENT INTERFACE (MDI) be used in Forms 4.5 ? 101. When is a .FMB file extension is created in Forms 4.5 ? 102. What is a Built_in subprogram ? 103. What is a RADIO GROUP ? 104. Identify the Odd one of the following statements ? 105. What is an ALERT ? 106. Can an Alert message be changed at runtime ? 107. Can we create an LOV without an RECORD GROUP ? 108. How many no of columns can a RECORD GROUP have ? 109. Oracle precompiler translates the EMBEDDED SQL statemens into 110. Kind of COMMENT statements placed within SQL statements ? 111. What is the appropriate destination type to send the output to a 112. What is TERM ? 113. If the maximum records retrieved property of a query is set to 10, then a summary value will 114. With which function of a summary item in the COMPUTE AT optio required ? 115. For a field in a repeating frame, can the source come from a column which does not exist in 116. What are the different file extensions that are created by Oracle Reports ? 117. Is it possible to Disable the Parameter form while running the report? 118.What are the SQL clauses supported in the link property sheet ? 119. What are the types of Calculated columns available ? 120. If two groups are not linked in the data model editor, what is the hierarchy between them? 121. Sequence of events takes place while starting a Database is 122. SYSTEM TABLESPACE can be made off-line 123. ENQUEUE_RESOURCES parameter information is derived from 124. SMON process is used to write into LOG files 125. EXP command is used 126. SNAPSHOTS cannot be refreshed automatically 127. The User can set Archive file name formats 128. The following parameters are optional in init.ora parameter file DB_BLOCK_SIZE, PROCESS 130. Constraints cannot be exported through Export command? 131. It is very difficult to grant and manage common priveleges needed by 132. The status of the Rollback segment can be viewed through 133. Explicitly we can assign transaction to a rollback segment 134. What file is read by ODBC to load drivers ? |