Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. query to find those student names who did not appear in all exams [modified]

query to find those student names who did not appear in all exams [modified]

Scheduled Pinned Locked Moved ASP.NET
databasequestion
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pankaj Garg
    wrote on last edited by
    #1

    student table id stu 1 s1 2 s2 subject table id sub 1 sub1 2 sub2 student-subject table id sid subid marks 1 1 1 100 2 1 2 100 3 2 1 100 My question is what shall be the query for those students who did not appear in all exams

    If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

    modified on Monday, July 7, 2008 3:19 AM

    E 1 Reply Last reply
    0
    • P Pankaj Garg

      student table id stu 1 s1 2 s2 subject table id sub 1 sub1 2 sub2 student-subject table id sid subid marks 1 1 1 100 2 1 2 100 3 2 1 100 My question is what shall be the query for those students who did not appear in all exams

      If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

      modified on Monday, July 7, 2008 3:19 AM

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      check out the exists option: http://www.techonthenet.com/sql/exists.php

      P 1 Reply Last reply
      0
      • E eyeseetee

        check out the exists option: http://www.techonthenet.com/sql/exists.php

        P Offline
        P Offline
        Pankaj Garg
        wrote on last edited by
        #3

        can u prease provide the query ?I am in urgent need of it:). I have gone through the qrticle . But not geting to construct the query

        If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

        E 1 Reply Last reply
        0
        • P Pankaj Garg

          can u prease provide the query ?I am in urgent need of it:). I have gone through the qrticle . But not geting to construct the query

          If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

          E Offline
          E Offline
          eyeseetee
          wrote on last edited by
          #4

          select * from table1 where not exists (select * from table2 where table2.id = table1.id) something like that

          P H 2 Replies Last reply
          0
          • E eyeseetee

            select * from table1 where not exists (select * from table2 where table2.id = table1.id) something like that

            P Offline
            P Offline
            Pankaj Garg
            wrote on last edited by
            #5

            still not working , i have three tables 1.student 2.subject 3.mixed of student and subject. form the above table , i want to find out those students who did not appear in all exams

            If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

            E 1 Reply Last reply
            0
            • E eyeseetee

              select * from table1 where not exists (select * from table2 where table2.id = table1.id) something like that

              H Offline
              H Offline
              hogan john
              wrote on last edited by
              #6

              What you waiting for? He needs a ready made query that serves his purpose. Don’t you know that he don’t have much time to do research on it?

              E 1 Reply Last reply
              0
              • P Pankaj Garg

                still not working , i have three tables 1.student 2.subject 3.mixed of student and subject. form the above table , i want to find out those students who did not appear in all exams

                If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

                E Offline
                E Offline
                eyeseetee
                wrote on last edited by
                #7

                do I have to spell it out for you, try playing around with the query yourself: you need to select all fields from student which arent in subject and match the id to them

                1 Reply Last reply
                0
                • H hogan john

                  What you waiting for? He needs a ready made query that serves his purpose. Don’t you know that he don’t have much time to do research on it?

                  E Offline
                  E Offline
                  eyeseetee
                  wrote on last edited by
                  #8

                  If this is a sarcastic reply then I'm smiling to myself as you know what these people are like If this is a serious demand then I'm def not smiling!

                  H 1 Reply Last reply
                  0
                  • E eyeseetee

                    If this is a sarcastic reply then I'm smiling to myself as you know what these people are like If this is a serious demand then I'm def not smiling!

                    H Offline
                    H Offline
                    hogan john
                    wrote on last edited by
                    #9

                    No buddy. :) I didn’t mean that. Actually I feel bore to these kind of people who always looking for a spoon feeding. My apologies if my comment hurt you.

                    E 1 Reply Last reply
                    0
                    • H hogan john

                      No buddy. :) I didn’t mean that. Actually I feel bore to these kind of people who always looking for a spoon feeding. My apologies if my comment hurt you.

                      E Offline
                      E Offline
                      eyeseetee
                      wrote on last edited by
                      #10

                      haha no it didnt hurt me, just good that someone has the same opionion of these people who just expect us to do all the work. happy programming!

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups