This discussion is archived
1 2 3 4 Previous Next 47 Replies Latest reply: Jan 21, 2013 1:40 AM by BluShadow RSS

plzzzzzzzzzzzz help

985803 Newbie
Currently Being Moderated
Display dept id along with name of all employees in that department
The output will be as such:
Dept ID Employee
10 Michael, Arnold
20 Bob,Maria,Peter
......
2) Display name, salary and running total salary.
The output will be as such:
Name Salary Running Total Salary
Bob 8000 8000
Maria 12000 20000
Peter 16000 36000
.......
3) Display name of first employee, third employee, and so forth.


plzzzzzzzzzzzzz i hav no idea how to solve this query......................plz do the needful asap
  • 1. Re: plzzzzzzzzzzzz help
    6363 Guru
    Currently Being Moderated
    How much of your homework have you done so far?
  • 2. Re: plzzzzzzzzzzzz help
    985803 Newbie
    Currently Being Moderated
    sir plzzzzzzzz help
  • 3. Re: plzzzzzzzzzzzz help
    sb92075 Guru
    Currently Being Moderated
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ


    stop whining!
  • 4. Re: plzzzzzzzzzzzz help
    6363 Guru
    Currently Being Moderated
    982800 wrote:
    sir plzzzzzzzz help
    Who is Sir Plzzzzzzzz? Do you mean surplus?
  • 5. Re: plzzzzzzzzzzzz help
    985803 Newbie
    Currently Being Moderated
    sir plzzzzzzzzzzzz help
  • 6. Re: plzzzzzzzzzzzz help
    985803 Newbie
    Currently Being Moderated
    can u help on the same????
  • 7. Re: plzzzzzzzzzzzz help
    rp0428 Guru
    Currently Being Moderated
    >
    hav no idea how to solve this query
    >
    If you want help you need to answer the questions that are asked of you.

    1. Who ask you to do this?

    2. Why do they expect you to be able to do this? Are you an Oracle expert? Are you a student taking a class?

    3. Did you ask the person that gave you this task for help? If so, what did they say?

    Whenever you have a problem with anything, in any area, that you don't understsand the first thing you should do is ask the person who gave you the task to explain it. If you still don't understand ask that person for help. Ask them to tell you how to get started.
  • 8. Re: plzzzzzzzzzzzz help
    Justin Cave Oracle ACE
    Currently Being Moderated
    In general, we are happy to help people out. However, we are generally not happy to do your entire assignment for you. Your professor has presumably assigned you homework so that you can learn from doing-- having us do the work robs you of the opportunity to learn.

    If you read the FAQ that has been posted, it has a number of suggestions for how to formulate a question that people will be happy to answer. If you can show us that you have attempted something and you can tell us what part of the question you are struggling with, someone will likely be happy to help. If you post the entire assignment, show no effort on your part to solve any of the problems, and use IM-speak to beg for help, you're probably going to be ignored.

    Justin
  • 9. Re: plzzzzzzzzzzzz help
    6363 Guru
    Currently Being Moderated
    982800 wrote:
    can u help on the same????
    Here you go

    http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/toc.htm

    http://docs.oracle.com/cd/E11882_01/server.112/e26088/toc.htm

    It will probably take a day or two but that shouldn't be a problem you can always retake a class and start studying a bit earlier next time.
  • 10. Re: plzzzzzzzzzzzz help
    Frank Kulash Guru
    Currently Being Moderated
    Hi,

    Welcome to the forum!

    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    If you can show the problem using commonly available tables (such as those in the scott or hr schemas) then you don't need to post any sample data; just the results and the explanation. For example, the scott.emp table has deptno, ename and sal columns. They're not exactly the same as your table, but if you see a soltuion that works for scott.emp, adapting it to your table will be trivial.
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    982800 wrote:
    Display dept id along with name of all employees in that department
    The output will be as such:
    Dept ID Employee
    10 Michael, Arnold
    20 Bob,Maria,Peter
    ......
    This does look a lot like homework, so I'll try not to ruin it for you.
    This problem involves String Aggregation . Oracle-Base has a very good page showing several ways to do this, appropriate for different Oracle versions (what is yours?) and different requirements (what are yours?).
    2) Display name, salary and running total salary.
    The output will be as such:
    Name Salary Running Total Salary
    Bob 8000 8000
    Maria 12000 20000
    Peter 16000 36000
    .......
    Whenever you hear "running" think "analytic".
    This is a job for the analytic SUM function. All the built-in functions, including SUM, are documented in the SQL Language manual.
    3) Display name of first employee, third employee, and so forth.
    I'm not sure I understand what you want here. This is one reason why you need to post some sample data, and the results you want from that data.

    Perhaps you need the analytic ROW_NUMBER function to tell you that this is row 1, 2, 3, .... Given that number, the MOD function can tell you if it's an even or odd number, and you can use a WHERE clause to show only odd-numebred rows.
    plzzzzzzzzzzzzz i hav no idea how to solve this query
    Do you mean "these queries"? That is, do you want 3 different queries, or 1 big query that answers all 3 questions? If you want 1 big query, what is the exact output you want?

    If you'd like help for any of these, post your best attempt, and a specific question.
    ......................plz do the needful asap
    It's quite rude to say things like that to the people who are volunteering to help you. Don't use words (or abbreviations) like "asap" or "urgent" on this forum. (Be careful using them anywhere.)
  • 11. Re: plzzzzzzzzzzzz help
    985803 Newbie
    Currently Being Moderated
    it was my interview questions... so i dont want to get failed again.. so if u will help me in this it will b great help for my future. its my humble request
  • 12. Re: plzzzzzzzzzzzz help
    6363 Guru
    Currently Being Moderated
    Quite a strange interview, the correct answer would be I don't know how to do that you wouldn't want to get mistakenly hired for job you can't do.
  • 13. Re: plzzzzzzzzzzzz help
    985803 Newbie
    Currently Being Moderated
    Thanks for your response...

    * i m looking for seperate ans for each query...

    sample data is for first query is ...

    1)-
    create table emp ( empno num(5) ,ename char(20), deptno num(5));
    insert into emp values(101 , 'ram' , 10)
    values(102, 'pawan' , 10)
                        values(103, 'vikas' , 20)
                        values(104, 'prabha' , 20)
                        values(105, 'rohit' , 30)
                        values(106, 'vishal' , 30);
    require output:

    deptid employees
    10 ram,pawan
    20 vikas,prabha
    30 rohit,vishal

    2)

    create table emp(empno num(3), ename char(20), sal num(8));
    insert into emp values(101,xxx,3400)
    values(102,yyy,5500)
    values(101,zzz,1400)
    values(101,aaa,3700)
    values(101,bbb,3900)
    values(101,ccc,4400);

    The output will be as such:
    Name Salary Running Total Salary
    xxx 3400 3400
    yyy 5500 8900
    zzz 1400 10300
    ......... so on

    3) looking 1st 3rd and 6th employee from list

    4) looking for all dates of every friday in current year
  • 14. Re: plzzzzzzzzzzzz help
    985803 Newbie
    Currently Being Moderated
    Thanks for your advice...
1 2 3 4 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points