Home » SQL & PL/SQL » SQL & PL/SQL » pls help i have some queries!
icon14.gif  pls help i have some queries! [message #197157] Tue, 10 October 2006 05:17 Go to next message
vikram_one
Messages: 8
Registered: October 2006
Junior Member
Hi friends,

I m new to sql, i want to clarify this queries. I searched in google, but i m not get
proper solution. If you know this pls reply. Its very urgent.



1. Find all employees who are living in the same city from the Employee table?

2. Write a query to convert all the letters in word to upper case.

3. What are the different types of Stored Procedure?

4. What is the difference between cluster index and non-cluster index?

5. How 2 handle SQL stored procedure?

6. How to find sixth highest salary from the employee table?



pls help.......

Thanks in advance

- vikram
Re: pls help i have some queries! [message #197174 is a reply to message #197157] Tue, 10 October 2006 06:07 Go to previous messageGo to next message
Littlefoot
Messages: 20897
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
1. I didn't know Google knows where all the people from my company live

2. Ask the operator to press <Caps Lock> once and never again

3. S, M, L, XL and XXL

4. "non-cluster" index has an extra "non" attached to it

5. With care; they are fragile

6. Ask a lady who calculates salaries

OK, now seriously: first two tasks really shouldn't be a problem, even to a novice (hint: use CITY ID in the WHERE clause; UPPER is the keyword).
Third and fourth require reading a documentation.
Fifth is, well, not very clear - what do you mean by "handling a stored procedure"?
Sixth can be found using the "top-n rows" techniques.

When you figure that out, do come back, show what you've done and what problems you have. Then we'll see what next.

[Updated on: Tue, 10 October 2006 06:07]

Report message to a moderator

Re: pls help i have some queries! [message #197175 is a reply to message #197157] Tue, 10 October 2006 06:08 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
I wonder if it was urgent because it was a job interview or a coursework deadline ?
Re: pls help i have some queries! [message #197178 is a reply to message #197174] Tue, 10 October 2006 06:31 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
ROFLMAO
Laughing
Re: pls help i have some queries! [message #197183 is a reply to message #197178] Tue, 10 October 2006 07:12 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Gentlemen,
it seems that the Community Hangout thread brought up a new kind of replies. Trying to make the list?

@vikram_one: read the first topic in the newbie forum for posting guidelines to avoid threads like this in the future.

Now, as for your questions:
1. Tip: look up the WHERE keyword in the SQL Reference
2. Tip: look up the UPPER keyword in the SQL Reference
3. procedures, functions, packages.
4. A cluster index is an index on a ... .
5. Does not compute. SQL stored procedures?
6. Do a search for nth. The FAQ pages address this issue too.

MHE
Re: pls help i have some queries! [message #197227 is a reply to message #197174] Tue, 10 October 2006 10:46 Go to previous messageGo to next message
vikram_one
Messages: 8
Registered: October 2006
Junior Member
ok thanks for your reply, i will try to findout the solution for this.


with regards
vikram
Re: pls help i have some queries! [message #197313 is a reply to message #197157] Tue, 10 October 2006 23:38 Go to previous messageGo to next message
shahidmughal
Messages: 91
Registered: January 2006
Location: Faisalabad Pakistan
Member

hi
see the answer below

ANSWER 1

try the following
BREAK ON DEPTNO
SELECT DEPTNO, ENAME FROM EMP ORDER BY DEPTNO;

DEPTNO ENAME
--------- ----------
10 CLARK
KING
MILLER
20 SMITH
ADAMS
FORD
SCOTT
JONES
30 ALLEN
BLAKE
MARTIN
JAMES
TURNER
WARD
ANSWER 2

try the following

select upper(fieldname) from tablename;

answer 6

try the following

select level,max(sal)
from emp
where level=6
connect by prior sal > sal
group by level

----------
check this example in scott/tiger login

1 select level,max(sal) from emp
2* connect by prior sal > sal group by level
SQL> /

LEVEL MAX(SAL)
--------- ---------
1 5000
2 3000
3 2975
4 2850
5 2450
6 1600
7 1500
8 1300
9 1250
10 1100
11 950
12 800

12 rows selected.

SQL> ed
Wrote file afiedt.buf

1 select level,max(sal) from emp
2 where level=6
3* connect by prior sal > sal group by level
SQL> /

LEVEL MAX(SAL)
--------- ---------
6 1600


i have written the answers of only three questions because of the shortage of time

regards

Muhammad Shahid Mughal
Re: pls help i have some queries! [message #197332 is a reply to message #197313] Wed, 11 October 2006 00:14 Go to previous messageGo to next message
vikram_one
Messages: 8
Registered: October 2006
Junior Member
hi Muhammad Shahid Mughal

Thanks a lot for your reply.


with regards
vikram
Re: pls help i have some queries! [message #197338 is a reply to message #197332] Wed, 11 October 2006 00:26 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
But take note that:
1. the answer to question 1 is not pure sql (BREAK is a SQL*Plus command) nor does it show only the employees of one department.

2. the answer to question 2 was already hinted to you before Wink

3. the answer to question 6 is on the board if you search!

MHE
Previous Topic: to get average sal without using average clause
Next Topic: Can we create index on view?
Goto Forum:
  


Current Time: Wed Dec 07 04:59:19 CST 2016

Total time taken to generate the page: 0.14028 seconds