Student with maximun calsses

I have a question, can you guys plz look into this.
Two tables student and class. I want to pull the data for the student with maximum number of classes
I am using
select student_name, count(*)
from student, class
group by student_name
The above query will give me all the students and there number of classes.
I only want to get the name of the student with maximum number of classes(only 1 row) and i cant use rownum.
Can anyone please look into this and throw some light on how to get the query.

Salim Chelabi  wrote:
YesWell, ok, one table scan, but one more step - VIEW - according to the explain plan. Still better to avoid the subquery.
SQL> explain plan for
  2  select max(dname) keep (dense_rank last order by count(*)) deptno
  3  from   dept, emp
  4  where  dept.deptno=emp.deptno
  5  group by dname;
Explained.
SQL> select * from table(dbms_xplan.display);
Plan hash value: 4041873517
| Id  | Operation                      | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT               |         |     1 |    16 |     7  (29)| 00:00:01 |
|   1 |  SORT AGGREGATE                |         |     1 |    16 |     7  (29)| 00:00:01 |
|   2 |   HASH GROUP BY                |         |     1 |    16 |     7  (29)| 00:00:01 |
|   3 |    MERGE JOIN                  |         |    14 |   224 |     6  (17)| 00:00:01 |
|   4 |     TABLE ACCESS BY INDEX ROWID| DEPT    |     4 |    52 |     2   (0)| 00:00:01 |
|   5 |      INDEX FULL SCAN           | PK_DEPT |     4 |       |     1   (0)| 00:00:01 |
|*  6 |     SORT JOIN                  |         |    14 |    42 |     4  (25)| 00:00:01 |
|   7 |      TABLE ACCESS FULL         | EMP     |    14 |    42 |     3   (0)| 00:00:01 |
Predicate Information (identified by operation id):
   6 - access("DEPT"."DEPTNO"="EMP"."DEPTNO")
       filter("DEPT"."DEPTNO"="EMP"."DEPTNO")
20 rows selected.
SQL> explain plan for
  2  select max(dname) keep (dense_rank last order by ct) deptno
  3  from   (select dept.dname, count(*) ct
  4          from   dept, emp
  5          where  dept.deptno=emp.deptno
  6          group by dname);
Explained.
SQL> select * from table(dbms_xplan.display);
Plan hash value: 3958887906
| Id  | Operation                       | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT                |         |     1 |    22 |     7  (29)| 00:00:01 |
|   1 |  SORT AGGREGATE                 |         |     1 |    22 |            |          |
|   2 |   VIEW                          |         |     4 |    88 |     7  (29)| 00:00:01 |
|   3 |    HASH GROUP BY                |         |     4 |    64 |     7  (29)| 00:00:01 |
|   4 |     MERGE JOIN                  |         |    14 |   224 |     6  (17)| 00:00:01 |
|   5 |      TABLE ACCESS BY INDEX ROWID| DEPT    |     4 |    52 |     2   (0)| 00:00:01 |
|   6 |       INDEX FULL SCAN           | PK_DEPT |     4 |       |     1   (0)| 00:00:01 |
|*  7 |      SORT JOIN                  |         |    14 |    42 |     4  (25)| 00:00:01 |
|   8 |       TABLE ACCESS FULL         | EMP     |    14 |    42 |     3   (0)| 00:00:01 |
Predicate Information (identified by operation id):
   7 - access("DEPT"."DEPTNO"="EMP"."DEPTNO")
       filter("DEPT"."DEPTNO"="EMP"."DEPTNO")
21 rows selected.
SQL>Nicolas.

Similar Messages

  • Looking for a reading App.  iPad (iOS 7.1.2) - Kindle.  I am looking for a good app that can help a college student with reading books that cannot be found on audio book. Voice over works, but monotone!

    Looking for a reading App.
    iPad (iOS 7.1.2) - Kindle.
    I am looking for a good app that can help a college student with reading books that cannot be found on audio book.  I have tried voice over and it works but it's very monotone and it really strings things together. 
    - I'm willing to pay for a good app but I can't seem to sort though the many that are out there. Any suggestions.

    Ah. I'm surprised, but there we go.
    Have a look here ...
    http://jam.hitsquad.com/vocal/about2136.html
    (courtesy of googling 'OSX free multitrack recording software')
    Didn't have time to do more than skim, but 'Ardour' looked promising. Protools is the only one I've used, the full product is one of the industry standards, but the free 'lite' version listed here seems to be limited to 2 in/out as well.
    Referring to your original post, I'd think trying to write or 'script' something would be a nightmare ... synchronisation of streams within something like Applescript would be a major issue, quite apart from anything else.
    G5 Dual 2.7, MacMini, iMac 700; P4/XP Desk & Lap.   Mac OS X (10.4.8)   mLan:01x/i88x; DP 5.1, Cubase SX3, NI Komplete, Melodyne.

  • STUDENT WITH VISUAL PROBLEMS

    Dear Adobe,
    currently I'm working in a school with young people of 18 years old. The students all study graphic design and learn indesign, photoshop and illustrator. All of our students have a disability (physically or autism). One of them has a serious problem with his eyes. For example, when he's working in Indesign he can't see the hairlines- and the design he makes are not good as a result. Can we adjust settings, line-thickness or anything? (Zooming doesn't do it) Hopefully we can find a sollution because otherwise he will fail this year's course. greetings Bert

    I think you're missing the point. We are evaluating if the student can 
    stay at the school because his visus-problems are so big (multiple 
    problems-not only hairlines). So now we are asking for help, if you 
    know a sollution, I would like to hear it.
    www.bekvis.be
    T. 0032 486 75 71 63
    BE96779599505605
    0831.994.338
    Op 08 Sep 2013, om 18:53 heeft MW Design het volgende geschreven:
    Re: STUDENT WITH VISUAL PROBLEMS
    created by MW Design in InDesign - View the full discussion
    Hairlines? What is their use?
    >
    And why cannot his designs avoid the use of hairlines? Seems rather 
    harsh to fail a student for the inability to avoid the use of 
    hairlines.
    Please note that the Adobe Forums do not accept email attachments. 
    If you want to embed a screen image in your message please visit the 
    thread in the forum to embed the image at http://forums.adobe.com/message/5663190#5663190
    Replies to this message go to everyone subscribed to this thread, 
    not directly to the person who posted the message. To post a reply, 
    either reply to this email or visit the message page: [http://forums.adobe.com/message/5663190#5663190
    To unsubscribe from this thread, please visit the message page at [http://forums.adobe.com/message/5663190#5663190
    ]. In the Actions box on the right, click the Stop Email 
    Notifications link.
    Start a new discussion in InDesign by email or at Adobe Community
    For more information about maintaining your forum email 
    notifications please go to http://forums.adobe.com/message/2936746#2936746

  • Financial Hold for students with debt

    hi experts,
    We have created a financial hold for the students with dunning, this hold is working fine, if a student has any level of dunning we are putting a Hold in the student´s file. The students with this kind of hold won´t be able to register again until the hold is remove.
    If a student later pays in the cash desk, the event CMAC_EVENT_0020_HOLD_REMOVE is removing the hold.
    This is OK, but when we are using FP05 to pay the over due payments the hold remains.
    I have check documentation of CMAC_EVENT_0020_HOLD_REMOVE and it has a condition which prevents to remove holds from payment lots (HERFK= 05), the FM works only with HERFK =01, 19,20,21 and 22.
    How can we remove financial holds when the balance of account is zero or positive, by using the payment lots.
    Regards,
    Sergio

    Hello Sergio,
    Can you explain why you want to clear the hold via FP05 (herkf = 05)?
    When the student pays in the cash desk there will be created a payment lot as well (using transaction FP05) but the HERKF=19, you said that this works.
    If you want to get rid of the financial hold via FP05 you can look at event 0020 (tc FQEVENTS). There you can add your own function module (adjustment of CMAC_EVENT_0020_HOLD_REMOVE  for example) . When you post via FP05 the system triggers the custom made function module.
    Kind regards,
    Steve de Klonia

  • How can i find out, if I am allowed to buy Photoshop CS6 Extended Student with my University?

    Hello,
    How can i find out, if I am allowed to buy Photoshop CS6 Extended Student with my University?
    I go to the DHBW in Mosbach (Germany), and I am studiing engineering.
    Can somebody say me am I allowed?

    Almost certainly yes.
    http://www.adobe.com/nz/education/student-eligibility-guide.edu.html

  • I'm using numbers for my students grades. the passing grade is 30 points. what i want to happen is that very students with a grade of less than 30 will have their points it red color. does the IF function can do this? how?

    i'm using numbers for my students grades. the passing grade is 30 points. what i want to happen is that very students with a grade of less than 30 will have their points it red color. does the IF function can do this? how?

    Hi efren
    Conditional format will do this.
    Select the Cells, then Menu > Format > Show Conditional Format Rules
    Regards,
    Ian.

  • I am a Communications student with my major in journalism and Broadcasting. Should i get a MacBook Air or a MacBook Pro?

    I am a university student and I currently use a Windows computer but I think it's time for a Mac upgrade. I'll be using it for writing lots of word documents and powerpoints, LOTS of web surfing espescially with many tabs and watching shows from my external hardrive. I'll be using some Adobe programs like Dreamweaver, Photoshop or Flash. I'll need to install the Windows OS into the laptop as well for my work. I'm also a light gamer. Mostly for the Dragon Age but that's not important. Portability, convenience and battery life is very important. I would hate to carry around a heavy laptop everyday.
    I'm aiming for the either the 256GB, 13inch MacBook Air or the 13inch MacBook Pro. I'm not sure if I need such a high peformance laptop like the Pro but i'm also unsure if the Air is up for the job. The only reason why im hesitant to get the Pro is because it's very expensive and it's too heavy, Which one do you think i should get?

    Macbook Pro 13-inch will do fine.
    If you prefer a lightweight computer, Macbook Air 13-inch is the right choice
    Consider 8-16GB RAM and 256 GB SSD.
    Best.

  • Macbook Air or Pro for student with Mac pro already

    Hi guys,
    I already have a Mac Pro as a desktop, but I need a notebook for High School (Yr 11 student in Australia)
    I am deciding whether to get a MBA or MBP.
    Macbook Air
    11in Screen
    128GB SSD
    Core i5
    Backlit Keyboard
    Lightweight
    But, Less value for money
    Macbook Pro (refurb.)
    (Early 2011 Model)
    13in Screen
    320GB HDD
    Core i5
    Backlit Keyboard
    Sturdy
    More value for money, but unnescessary power
    $1099
    Optical Drive
    The MBP has lots of power, more USB ports (3?) and SD Card Slot, along with optical drive. But it is also just over twice the weight and thickness.
    The MBA is sleek and beautiful, has two usb ports (really all I need) is fast, but costs $150 more, for a hard drive half the size, and a smaller screen size and is really light.
    I don't need heaps of processing power, I need a laptop that goes on the bus everyday, and needs to be sturdy (a little worried about the MBA on buses and bags being thrown around - but nothing a case cant fix). Im just thinking i dont need the extra power of the Pro, but a lot of people in my classes have the 13in so I am confused about what to get.
    Thanks

    I think you have answered your own question.
    If you value portability more than power, then the MBA 11" is the way to go.
    For most day-to-day computing, there's not much between the MBA 11" and MBP 13". The MBA may in fact feel faster due to the SSD than the MBP with is mechanical HD.
    I have the MBA 11" and am happy with its performance compared to the 13" MBP.

  • Download US Photoshop Elements 13 Student with German ID

    My daughter is a German student, proved by a German student ID card, and wishes to obtain the Photoshop Elements 13/Premiere Elements 13 Student & Teacher bundle. The German edition is not yet available for another couple days, so we thought about obtaining the US download from amazon.com. Question: Will legitimization with a German student ID card work in that situation or will that only create problems?

    Geodaisy I would recommend waiting until the proper language/offering is available in your region.  If you bought a US Education version it may not be applicable for an individual in Germany.

  • Mac Air vs. iPad Air for a college student with writing courses.

    Along with the occasional short story, I enjoy taking photos and editing them. Also need an HP Photo printer that has AirPrint. Any suggestions?

    Note: Check to make sure you can format your documents how you like.  Footnoting tends to have limited fixiblity.  Some profs my not accept these limitations.
    Check around and see if you might be missing common apps.  Some online learning course have not been updated to support mobile devices.
    In a local college library I have noticed that the students have made a rapid move to the Mac platform from 20% to 70%.  I do not see many tablets.
    Robert

  • Am a Student with .edu email but not getting discount

    Recently I've checked my email and saw that I have been paying full price at $9.99 for the past 2 months instead of $4.99. I have a .edu email address and am currently a student, but I don't know why I'm not getting the discount anymore. I just canceled my Spotify Premium subscription and even tried following the directions here:https://community.spotify.com/t5/Help-Accounts-and-Subscriptions/Switch-to-Student-Discount/td-p/887329 I really like using Spotify and enjoy how sophisticated it is and would really want to get the discount that I should be getting + my money back for being overcharged earlier. Also, when I went to https://spotify.sheerid.com/ to verify that I was a student, it said it was verified and forwarded me to spotify's website, which said it was not verified. I hope you guys can help me out ASAP. Thanks!

    Hi hokstuff. Since you've already tried doing everything on your end to get the discounted subscription, you're going to want to get in touch with support, and then they'll be able to help you out and get this all sorted. Note that if you receive an automated email directing you to the community and/or help boards, make sure you reply directly to that email (even if it is from a no reply address) and support will get back to you as soon as possible. Please let me know if you have any other questions or concerns, and best of luck! Cheers!

  • Discount Creative Cloud for Students with 2-4 Apps to choose from?

    Will there be anything like this anytime soon? Like that you can choose the apps you need for a lesser price? I don't need the whole master suite and I can't afford 30€ every month for this.
    I only truly need Photoshop, Indesign and AfterEffects. The others apps are not that important for me, as I have other more cost efficient or free programms for that. I would only be missing out on Illustrator, but I can live with that.
    I imagine something like 3 programms for 10€ a month, that would be affordable. Or that you pay 3-5€ per app as a student. (Currently it's 19€=25$ for the first year and then 29€=38$ forevermore...)
    If you are professional I can understand that you have to pay and invest that money, but as a student the pricing is just unfair. I think it's no wonder that so many people pirate Adobe programms, under that price policy monopolism. Where should you learn those programms that are required to apply for a job when they cost a fortune? What about people who have no money? Should they be denied to educate themselves?
    Applause to Autodesk for offering free educational software!!!
    (This post is no utopia)

    This is an open forum with a mix of program users and Adobe staff, not Adobe support... you need Adobe support
    Adobe contact information - http://helpx.adobe.com/contact.html may help
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • Is there a monthly plan for students with NO annual commitment?

    Hello,
    I'm a student and I need the Creative Cloud for a current project.
    However, chances are that I'll be travelling this summer and not using it for several month. So I was wondering if there is a monthly plan for students that can be cancelled at any time without a 50% cancellation fee?
    Many thanks,
    Viley

    Hi Viley,
    Welcome to Adobe Forums.
    For Student and Teacher we have a plan with one year committment only . I will share the links that will give you much more clarity on the same -
    https://creative.adobe.com/plans
    and
    http://www.adobe.com/products/creativecloud/buying-guide-at-a-glance.edu.html
    Let us know if that helps !
    Thanks
    Garima

  • CS4 Production Premium (Student) with Windows 7

    Hi,
    I've just bought a new laptop which comes with Windows 7. I'm looking to get CS4 Production Premium ASAP because I have a lot of work to do over Christmas. Everywhere I have looked for it (Amazon, Studica Lambda Tek) they seem to suggest it is only compatible with XP and Vista. Is this the case? I thought the student suites were exactly the same other than their rules on commercial use but is it possible that the new versions of the normal suites are compatible with Windows 7 but they haven't updated the student ones?
    Thanks,
    Peter.

    There is no update on the CS4 for Windows 7 compatibility. All versions are Windows 7-compatible.
              - Dov

  • Virtual station (w/ Win 7, Visual Studio, SQL Server) accessible by web for students with Dreamspark license.

    Can an educational institution using Dreamspark Premium license create a virtual machine running Win 7, SQL, Visual Studio which will be available for students to use from their home?

    Hi Sir,
    I assume that you are using 2012/R2 server .
    As you know , standard version can run two instance and datacenter with unlimited number of VM.
    For server , it allows two account logon at the same time by defult .
    For client , it only allows one account logon at the same time .
    If you need more than two students to use that hyper-v server via RDP connection  at the same time you may need to enable "RDS" and it will need RDS CAL .
    I would suggest you to contact Microsoft Activation center for further assistance of license issue :
    http://www.microsoft.com/licensing/existing-customers/activation-centers.aspx
    Best Regards
    Elton Ji
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

Maybe you are looking for