Home » Other » Training & Certification » Interview questions.. please help answer
Interview questions.. please help answer [message #116933] Sat, 23 April 2005 11:24 Go to next message
vgs2005
Messages: 123
Registered: April 2005
Senior Member
Hi,
I'm preparing for an interview. It will be very helpful in my preparation if you can provide the answers for the following questions.

- How will you copy the structure of a table without copying the data?
- What is DYNAMIC SQL method 4?
- How to remove duplicate records from a table?
- What is the use of ANALYZing the tables?
- What is a "transaction"? Why are they necessary?
- How to convert RAW datatype into TEXT?
- What are "HINTS"?
- What is "index covering" of a query?
- Difference between "VARCHAR" and "VARCHAR2" datatypes.
- How to create a database link ?
- Can a stored procedure call itself(recursive). If yes what level and can it be controlled.?
- How do you measure the performance of a stored procedure?

thanks in advance...

Re: Interview questions.. please help answer [message #117171 is a reply to message #116933] Mon, 25 April 2005 10:14 Go to previous messageGo to next message
d.dineshkumar
Messages: 211
Registered: April 2005
Location: Kolkatta
Senior Member
Q. How will you copy the structure of a table without copying the data?
A.CREATE TABLE T1 AS SELECT * FROM T2 WHERE 1=2;
Q.- How to remove duplicate records from a table?
A.DELETE FROM T1 T WHERE ROWID NOT IN (SELECT MIN(ROWID) FROM TABLE T1 T2 WHERE T1.KEY_COL=T2.KEY_COL);
q.What is the use of ANALYZing the tables?
A.FOR THE USE OF COST BASED OPTIMZER.
Q.- What are "HINTS"?
A.FOR OPTIMIZER.
Q.How to create a database link ?

A.CONNECT system/manager
CREATE PUBLIC DATABASE LINK boston_server USING ’inst1_alias’;
Embarassed
Re: Interview questions.. please help answer [message #117462 is a reply to message #117171] Wed, 27 April 2005 07:57 Go to previous messageGo to next message
vgs2005
Messages: 123
Registered: April 2005
Senior Member
Thanks a lot! Found some of the answers from a book, too. By the way, (please bear with me) - what does it mean when a WHERE condition has an equation with 2 integers - like what you wrote:

..SELECT * FROM T2 WHERE 1=2;

I saw this once before, but failed to understand.
Re: Interview questions.. please help answer [message #117470 is a reply to message #116933] Wed, 27 April 2005 08:19 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
Because it is two constant integers, it is something you can control to always be true or always be false. where 1=2 is never going to happen, because one will never equal two. where 1=1 will always happen.
Re: Interview questions.. please help answer [message #117748 is a reply to message #117470] Fri, 29 April 2005 07:42 Go to previous messageGo to next message
vgs2005
Messages: 123
Registered: April 2005
Senior Member
So if
Select * from emp;
returns 5 rows (with columns: name, id, dept, salary)
what does
Select * from emp where 1=1;
return? OR how will the output be?
How about
Select * from emp where 1=2;

Sorry, I know I can easily answer this if I have a SQLPLus in my PC. Unfortunately, I just moved in to a new place and yet to find a 'job' so don't have my PC with me right now..

Thanks in advance...



Re: Interview questions.. please help answer [message #117822 is a reply to message #117748] Fri, 29 April 2005 15:59 Go to previous messageGo to next message
joy_division
Messages: 4949
Registered: February 2005
Location: East Coast USA
Senior Member
"where 1=1" is always true, therefore all 5 rows will be returned.

"where 1=2" is never true, therefore no rows will be returned.

QED
Re: Interview questions.. please help answer [message #118115 is a reply to message #117822] Tue, 03 May 2005 02:52 Go to previous messageGo to next message
vgs2005
Messages: 123
Registered: April 2005
Senior Member
When you say

"where 1=2" is never true, therefore no rows will be returned.

Will it display "No rows selected" or it will just display the column names?

Re: Interview questions.. please help answer [message #118121 is a reply to message #116933] Tue, 03 May 2005 03:07 Go to previous message
rumasinha
Messages: 12
Registered: May 2005
Location: Bangalore
Junior Member
It will display No Rows Selected.
Previous Topic: OCA/OCP details
Next Topic: OCP 9i DBA Training Program @ Hyderbad from 23rd May @005
Goto Forum:
  


Current Time: Thu Oct 29 12:20:29 CDT 2020