GATE Exam  >  GATE Questions  >  Consider the relationStudents(Rollno, Name, M... Start Learning for Free
Consider the relation
Students(Rollno, Name, Marks)
Where rollno is the primary key.
Now we would like to rank the students according to the decreasing marks. The student with the highest marks gets rank 1. Ties are not broke but ranks are skipped.
Now consider 2 queries.
Query1: SELECT A .Name, count (B .Name)
From Students A, Students B
Where A.Marks <= B.Marks group by A .Name
Query2: SELECT A .Name, 1+count (B .Name)
From Students A, Students B
Where A.Marks < B .Marks group by A .Name
  • a)
    Query 1 and Query 2 are correct implementation of the given specification
  • b)
    Query 1 and Query 2 are not correct implementation of the given specification
  • c)
    Query 1 is the correct implementation of the specification but not Query 2
  • d)
    Query 2 is the correct implementation of the specification but not Query 1
Correct answer is option 'B'. Can you explain this answer?
Verified Answer
Consider the relationStudents(Rollno, Name, Marks)Where rollno is the ...
Both the queries generate the same result but none of them sort the students according to the decreasing marks.
View all questions of this test
Explore Courses for GATE exam

Similar GATE Doubts

Consider the relationStudents(Rollno, Name, Marks)Where rollno is the primary key.Now we would like to rank the students according to the decreasing marks. The student with the highest marks gets rank 1. Ties are not broke but ranks are skipped.Now consider 2 queries.Query1: SELECT A .Name, count (B .Name)From Students A, Students BWhere A.Marks <= B.Marks group by A .NameQuery2: SELECT A .Name, 1+count (B .Name)From Students A, Students BWhere A.Marks < B .Marks group by A .Namea)Query 1 and Query 2 are correct implementation of the given specificationb)Query 1 and Query 2 are not correct implementation of the given specificationc)Query 1 is the correct implementation of the specification but not Query 2d)Query 2 is the correct implementation of the specification but not Query 1Correct answer is option 'B'. Can you explain this answer?
Question Description
Consider the relationStudents(Rollno, Name, Marks)Where rollno is the primary key.Now we would like to rank the students according to the decreasing marks. The student with the highest marks gets rank 1. Ties are not broke but ranks are skipped.Now consider 2 queries.Query1: SELECT A .Name, count (B .Name)From Students A, Students BWhere A.Marks <= B.Marks group by A .NameQuery2: SELECT A .Name, 1+count (B .Name)From Students A, Students BWhere A.Marks < B .Marks group by A .Namea)Query 1 and Query 2 are correct implementation of the given specificationb)Query 1 and Query 2 are not correct implementation of the given specificationc)Query 1 is the correct implementation of the specification but not Query 2d)Query 2 is the correct implementation of the specification but not Query 1Correct answer is option 'B'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Consider the relationStudents(Rollno, Name, Marks)Where rollno is the primary key.Now we would like to rank the students according to the decreasing marks. The student with the highest marks gets rank 1. Ties are not broke but ranks are skipped.Now consider 2 queries.Query1: SELECT A .Name, count (B .Name)From Students A, Students BWhere A.Marks <= B.Marks group by A .NameQuery2: SELECT A .Name, 1+count (B .Name)From Students A, Students BWhere A.Marks < B .Marks group by A .Namea)Query 1 and Query 2 are correct implementation of the given specificationb)Query 1 and Query 2 are not correct implementation of the given specificationc)Query 1 is the correct implementation of the specification but not Query 2d)Query 2 is the correct implementation of the specification but not Query 1Correct answer is option 'B'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider the relationStudents(Rollno, Name, Marks)Where rollno is the primary key.Now we would like to rank the students according to the decreasing marks. The student with the highest marks gets rank 1. Ties are not broke but ranks are skipped.Now consider 2 queries.Query1: SELECT A .Name, count (B .Name)From Students A, Students BWhere A.Marks <= B.Marks group by A .NameQuery2: SELECT A .Name, 1+count (B .Name)From Students A, Students BWhere A.Marks < B .Marks group by A .Namea)Query 1 and Query 2 are correct implementation of the given specificationb)Query 1 and Query 2 are not correct implementation of the given specificationc)Query 1 is the correct implementation of the specification but not Query 2d)Query 2 is the correct implementation of the specification but not Query 1Correct answer is option 'B'. Can you explain this answer?.
Solutions for Consider the relationStudents(Rollno, Name, Marks)Where rollno is the primary key.Now we would like to rank the students according to the decreasing marks. The student with the highest marks gets rank 1. Ties are not broke but ranks are skipped.Now consider 2 queries.Query1: SELECT A .Name, count (B .Name)From Students A, Students BWhere A.Marks <= B.Marks group by A .NameQuery2: SELECT A .Name, 1+count (B .Name)From Students A, Students BWhere A.Marks < B .Marks group by A .Namea)Query 1 and Query 2 are correct implementation of the given specificationb)Query 1 and Query 2 are not correct implementation of the given specificationc)Query 1 is the correct implementation of the specification but not Query 2d)Query 2 is the correct implementation of the specification but not Query 1Correct answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Consider the relationStudents(Rollno, Name, Marks)Where rollno is the primary key.Now we would like to rank the students according to the decreasing marks. The student with the highest marks gets rank 1. Ties are not broke but ranks are skipped.Now consider 2 queries.Query1: SELECT A .Name, count (B .Name)From Students A, Students BWhere A.Marks <= B.Marks group by A .NameQuery2: SELECT A .Name, 1+count (B .Name)From Students A, Students BWhere A.Marks < B .Marks group by A .Namea)Query 1 and Query 2 are correct implementation of the given specificationb)Query 1 and Query 2 are not correct implementation of the given specificationc)Query 1 is the correct implementation of the specification but not Query 2d)Query 2 is the correct implementation of the specification but not Query 1Correct answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider the relationStudents(Rollno, Name, Marks)Where rollno is the primary key.Now we would like to rank the students according to the decreasing marks. The student with the highest marks gets rank 1. Ties are not broke but ranks are skipped.Now consider 2 queries.Query1: SELECT A .Name, count (B .Name)From Students A, Students BWhere A.Marks <= B.Marks group by A .NameQuery2: SELECT A .Name, 1+count (B .Name)From Students A, Students BWhere A.Marks < B .Marks group by A .Namea)Query 1 and Query 2 are correct implementation of the given specificationb)Query 1 and Query 2 are not correct implementation of the given specificationc)Query 1 is the correct implementation of the specification but not Query 2d)Query 2 is the correct implementation of the specification but not Query 1Correct answer is option 'B'. Can you explain this answer?, a detailed solution for Consider the relationStudents(Rollno, Name, Marks)Where rollno is the primary key.Now we would like to rank the students according to the decreasing marks. The student with the highest marks gets rank 1. Ties are not broke but ranks are skipped.Now consider 2 queries.Query1: SELECT A .Name, count (B .Name)From Students A, Students BWhere A.Marks <= B.Marks group by A .NameQuery2: SELECT A .Name, 1+count (B .Name)From Students A, Students BWhere A.Marks < B .Marks group by A .Namea)Query 1 and Query 2 are correct implementation of the given specificationb)Query 1 and Query 2 are not correct implementation of the given specificationc)Query 1 is the correct implementation of the specification but not Query 2d)Query 2 is the correct implementation of the specification but not Query 1Correct answer is option 'B'. Can you explain this answer? has been provided alongside types of Consider the relationStudents(Rollno, Name, Marks)Where rollno is the primary key.Now we would like to rank the students according to the decreasing marks. The student with the highest marks gets rank 1. Ties are not broke but ranks are skipped.Now consider 2 queries.Query1: SELECT A .Name, count (B .Name)From Students A, Students BWhere A.Marks <= B.Marks group by A .NameQuery2: SELECT A .Name, 1+count (B .Name)From Students A, Students BWhere A.Marks < B .Marks group by A .Namea)Query 1 and Query 2 are correct implementation of the given specificationb)Query 1 and Query 2 are not correct implementation of the given specificationc)Query 1 is the correct implementation of the specification but not Query 2d)Query 2 is the correct implementation of the specification but not Query 1Correct answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider the relationStudents(Rollno, Name, Marks)Where rollno is the primary key.Now we would like to rank the students according to the decreasing marks. The student with the highest marks gets rank 1. Ties are not broke but ranks are skipped.Now consider 2 queries.Query1: SELECT A .Name, count (B .Name)From Students A, Students BWhere A.Marks <= B.Marks group by A .NameQuery2: SELECT A .Name, 1+count (B .Name)From Students A, Students BWhere A.Marks < B .Marks group by A .Namea)Query 1 and Query 2 are correct implementation of the given specificationb)Query 1 and Query 2 are not correct implementation of the given specificationc)Query 1 is the correct implementation of the specification but not Query 2d)Query 2 is the correct implementation of the specification but not Query 1Correct answer is option 'B'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev