Consider the table

Student(stuid, name, course, marks). Which one of the following two queries is

correct to find the highest marks student in course 5?

Q.1. Select S.stuid

From student S

Where not exists

(select * from student e where e course='5' and e marks ≥ s marks)

Q.2. Select S.stuid

From student S

Where s.marks > any (select distinct marks from student S where s.couse

= 5)

(A) Q.1

(B) Q.2

(C) Both Q.1 and Q.2

(D) Neither Q.1 nor Q.2

1 Answer

Answer :

(B) Q.2

Explanation: First query gives stuid of students whose marks are greater than all students taking course 5. Second query gives stuid of students whose marks are greater than any student taking course 5, that is in second query comparison is between min of marks by student enrolled in course 5 and in query one comparison is between maximum of marks by any student in course 5. So the answer is option D.

Related questions

Description : Consider the following three SQL queries (Assume the data in the people table) : (a) Select Name from people where Age>21; (b) Select Name from people where Height>180; (c) Select Name from people where (Age>21) or (Height ... number of rows returned by the SQL query (c) ? (A) 3 (B) 7 (C) 10 (D) 21

Last Answer : (C) 10

Description : Consider a database table R with attributes A and B. Which of the following SQL queries is illegal ? (A) SELECT A FROM R; (B) SELECT A, COUNT(*) FROM R; (C) SELECT A, COUNT(*) FROM R GROUP BY A; (D) SELECT A, B, COUNT(*) FROM R GROUP BY A, B;

Last Answer : (B) SELECT A, COUNT(*) FROM R;

Description : Suppose ORACLE relation R(A, B) currently has tuples {(1, 2), (1, 3), (3, 4)} and relation S(B, C) currently has {(2, 5), (4, 6), (7, 8)}. Consider the following two SQL queries SQ1 and SQ2 ... (A) 2 and 6 respectively (B) 6 and 2 respectively (C) 2 and 4 respectively (D) 4 and 2 respectively

Last Answer : (D) 4 and 2 respectively

Description : Consider the relations R(A,B) and S(B,C) and the following four relational algebra queries over R and S: I. πA,B(R⋈S) II. R⋈πB(S) III. R∩(πA(R) Χ πB(S)) IV. πA,R.B(R Χ S) where R.B refers to ... IV are the same query. (C) I, II and IV are the same query. (D) I, III and III are the same query.

Last Answer : (D) I, III and III are the same query.

Description : Consider the following statements related to compiler construction: I. Lexical Analysis is specified by context-free grammars and implemented by pushdown automata. II. Syntax Analysis is specified by regular expressions and implemented by ... Only l (2) Only ll (3) Both I and II (4) Neither I nor Il

Last Answer : Answer: 4

Description : A pushdown automation M = (Q, Σ, Γ, δ, q0, z, F) is set to be deterministic subject to which of the following condition(s), for every q ∈ Q, a ∈ Σ ∪ {λ} and b ∈ Γ (s1) δ(q, a, b) contains at most one ... ) must be empty for every c ∈ Σ (A) only s1 (B) only s2 (C) both s1 and s2 (D) neither s1 nor s2

Last Answer : (C) both s1 and s2

Description : Abstraction and encapsulation are fundamental principles that underlie the object oriented approach to software development. What can you say about the following two statements? I. Abstraction allows us to focus on what something ... and II are correct. (3) Only II is correct. (4) Only I is correct.

Last Answer : (1) Neither I nor II is correct.

Description : Consider a Hamiltonian Graph (G) with no loops and parallel edges. Which of the following is true with respect to this Graph (G) ? (a) deg(v) ≥ n/2 for each vertex of G (b) |E(G)| ≥ 1/2 (n-1)(n-2)+2 edges (c) deg(v) + deg( ... edge (A) (a) and (b) (B) (b) and (c) (C) (a) and (c) (D) (a), (b) and (c)

Last Answer : (D) (a), (b) and (c)

Description : Consider a schema R(MNPQ) and functional dependencies M→N, P→Q. Then the decomposition of R into R1(MN) and R2(PQ) is ............. (1) Dependency preserving but not lossless ... and lossless join (3) Lossless join but not dependency preserving (4) Neither dependency preserving nor lossless join. 

Last Answer : Answer: 1

Description : On the basis of the Table Student, write the output(s) produced by executing the following queries: -Technology

Last Answer : (i)Max(Average)Min(Average)9565(ii)NameShrishtiAdityaRitu RajSaumyaAshutoshAman

Description : Consider the following statements: Among the Indian States: 1. Andhra Pradesh has the longest coastline 2. Gujarat has the highest number of airports Which of the statements given above is/are correct? [IAS 2004] (a) only 1 (b) only 2 (c) Both 1 and 2 (d) Neither 1 nor 2

Last Answer : Ans: (d)

Description : Which of the following statement(s) is/are TRUE with regard to software testing? I. Regression testing technique ensures that the software product runs correctly after the changes during maintenance. II. Equivalence partitioning is a ... (1) only I (2) only II (3) both I and II (4) neither I nor II

Last Answer : (1) only I 

Description : Which of the following statement(s) with regard to an abstract class in JAVA is/are TRUE? I. An abstract class is one that is not used to create objects. II. An abstract class is designed only to act as a base class ... by other classes. (1) Only l (2) Only II (3) Neither I nor II (4) Both l and II

Last Answer : Both l and II

Description : Which of the following statement(s) regarding a linker software is/are true? I. A function of a linker is to combine several object modules into a single load module. II. A function of a linker is to replace absolute ... modules. (1) Only I (2) Only II (3) Both I and II (4) Neither I nor Il

Last Answer : Answer: 1

Description : Which of the following is/are correct with reference to Abstract class and interface ? (a) A class can inherit only one Abstract class but may inherit several interfaces. (b) An Abstract class can provide complete and default ... true (C) Both (a) and (b) are true (D) Neither (a) nor (b) is true

Last Answer : Answer: C

Description : The grammar with production rules S → aSb |SS|λ generates language L given by: (A) L = {w∈{a, b}* | na(w) = nb(w) and na(v) ≥ nb(v) where v is any prefix of w} (B) L = {w∈{a, b}* | na(w) = nb(w) and na(v ... (D) L = {w∈{a, b}* | na(w) ≠ nb(w) and na(v) ≤ nb(v) where v is any prefix of w}

Last Answer : (A) L = {w∈{a, b}* | na(w) = nb(w) and na(v) ≥ nb(v) where v is any prefix of w} 

Description : Consider the table STUDENT given below: RollNo Name Class DOB Gender City Marks 1 Anand XI 6/6/97 M Agra 430 -Technology

Last Answer : (1)b. Both (iii) and (iv)(2) b.RollnoNameClassDOBGenderCityMarks6734MaakhiyNehaGeetPreetiXIXXIXII12/12/948/12/956/5/978/8/95FFFFDubaiMoscowAgraMumbai256324470492

Description : (1) Prachi has given the following command to obtain the highest marks Select max(marks) from student where group by class; -Technology

Last Answer : (1)d. Select class, max(marks) from student group by class;(2)b. Both (ii) and (iv)(3)b. select name,max(DOB) from student;

Description : The student marks should not be greater than 100. This is (A) Integrity constraint (B) Referential constraint (C) Over-defined constraint (D) Feasible constraint

Last Answer : (A) Integrity constraint

Description : Consider the following two statements: (a) A publicly derived class is a subtype of its base class. (b) Inheritance provides for code reuse. Which of the following statements is correct? (A) Both the statements ( ... ) is correct and (b) is incorrect (D) Statement (a) is incorrect and (b) is correct

Last Answer : Answer: A

Description : Consider a CUSTOMERS database table having a column CITY filled with all the names of Indian cities (in capital letters). The SQL statement that finds all cities that have GAR somewhere in its name, ... *from customers where city like %GAR%'; (D) Select *from customers where city as '%GAR';

Last Answer : Answer: C

Description : Consider the following statements: 1. The continental shelves of Lakshadweep are originated due to coral reefs. 2. The continental shelves of western coast are due to faulting and submergence. Which of the statement(s) given above is/ ... (a) 1 only (b) 2 only (c) Both 1 and 2 (d) Neither 1 nor 2

Last Answer : Ans: (c)

Description : Consider the following Statements: Indicative Planning is a feature of Mixed Economy'. Perspective Planning is used by socialist countries where each and every aspect of planning is controlled by the State. Which of the above Statement( ... B. B Only 2 C. C Both 1 and 2 D. D Neither 1 nor 2

Last Answer : A. A Only 1

Description : Bacteria lack alternation of generation because there is (a) neither syngamy nor reduction division (b) distinct chromosomes are absent (c) no conjugation (d) no exchange of genetic materia

Last Answer : (a) neither syngamy nor reduction division

Description : Which of the following concurrency protocol ensures both conflict serializability and freedom from deadlock : I. 2-phase locking II. Time phase ordering (A) Both I & II (B) II only (C) I only (D) Neither I nor II

Last Answer : (B) II only

Description : Which of the following concurrency protocol ensures both conflict serializability and freedom from deadlock ? (a) 2-phase Locking (b) Time stamp - ordering (A) Both (a) and (b) (B) (a) only (C) (b) only (D) Neither (a) nor (b)

Last Answer : (C) (b) only

Description : Which of the following are facts about a top-down software testing approach? I. Top-down testing typically requires the tester to build method stubs. II. Top-down testing typically requires the tester to build test drivers. (1) only I (2) Only II (3) Both I and II (4) Neither I nor II

Last Answer : (1) only I

Description : A fuzzy set A on R is ................. iff A(λx1 + (1 – λ)x2) ≥ min [A(x1), A(x2)] for all x1, x2 ∈ R and all λ ∈ [0, 1], where min denotes the minimum operator. (A) Support (B) α-cut (C) Convex (D) Concave 

Last Answer : (C) Convex 

Description : A set of processors P1, P2, ......, Pk can execute in parallel if Bernstein's conditions are satisfied on a pair wise basis; that is  P1 || P2 || P3 || ..... || Pk if and only if: (A) Pi || Pj for all i ≠ j (B) Pi || Pj for all i = j+1 (C) Pi || Pj for all i ≤ j (D) Pi || Pj for all i ≥ j

Last Answer : (A) Pi || Pj for all i ≠ j Explanation: Bernstein's Condition: 1. If process Pi writes to a memory cell Mi, then no process Pj can read the cell Mi. 2. If process Pi read from a memory ... Mi. 3. If process Pi writes to a memory cell Mi, then no process Pj can write to the cell Mi.

Description : Consider the following table Furniture. Write SQL commands for the statements (i) to (viii) and write output for SQL queries (ix) and (x). -Technology

Last Answer : SQL commands for the given statements (i) to (viii) ;1. SELECT FCODE, NAME. PRICE FROM Furniture WHERE PRICE < 5000;2. SELECT NAME. PRICE FROM Furniture3.4. WHERE NAME LIKE %table% ;5. SELECT DISTINCT WCODE ... ;15.16. Output for SQL queries (ix) and (x)(ix)SUM(PRICE)6500(x)COUNT(DISTINCT PRICE)5

Description : What are the characteristics of Continuous and Comprehensive Evaluation ? (a) It increases the workload on students by taking multiple tests. (b) It replaces marks with grades. (c) It evaluates every aspect of the student. (d) It helps in ... ) and (d) (C) (a), (b) and (c) (D) (b), (c) and (d)

Last Answer : Answer: D

Description : Consider the following statements: 1. Biodiversity hots pots are located only in tropical regions. 2. India has four biodiversity hots pots, i.e., Eastern Himalayas, Western Himalayas, Western Ghats and Andaman and Nicobar Islands. Which ... (a) 1 only (b) 2 only (c) Both 1 and 2 (d) Neither 1 nor 2

Last Answer : Ans: (d)

Description : Preparedstatement Object in JDBC is used to execute ........................... queries. A) executable B) simple C) high level D) parameterized

Last Answer : D) parameterized

Description : Prepared Statement object in JDBC used to execute........... queries. A) Executable B) Simple C) High level D) Parameterized

Last Answer : D) Parameterized

Description : Which of the following is not the function of client? A) Compile queries B) Query optimization C) Receive queries D) Result formatting and presentation

Last Answer : B) Query optimization

Description : Which of the following is/are the Database server functions? i) Data management ii) Transaction management iii) Compile queries iv) Query optimization A) i, ii, and iv only B) i, ii and iii only C) ii, iii and iv only D) All i, ii, iii, and iv

Last Answer : A) i, ii, and iv only

Description : In a relational schema, each tuple is divided into fields called A) Relations B) Domains C) Queries D) All of the above

Last Answer : B) Domains

Description : Division operation is ideally suited to handle queries of the type : (A) customers who have no account in any of the branches in Delhi. (B) customers who have an account at all branches in Delhi. ( ... atleast one branch in Delhi. (D) customers who have only joint account in any one branch in Delhi

Last Answer : (B) customers who have an account at all branches in Delhi. 

Description : Which of the following control expressions are valid for an if statement? A) An integer expression B) A Boolean expression C) Either A or B D) Neither A nor B

Last Answer : B) A Boolean expression

Description : Which of the following control expressions are valid for an if statement? A) An integer expression B) A Boolean expression C) Either A or B D) Neither A nor B

Last Answer : B) A Boolean expression

Description : Which of the following control expressions are valid for an if statement? A) an integer expression B) a Boolean expression C) either A or B D) Neither A nor B

Last Answer : B) a Boolean expression

Description : If f(x, y) is a digital image, then x, y and amplitude values of f are (A) Finite (B) Infinite (C) Neither finite nor infinite (D) None of the above

Last Answer : (A) Finite

Description : Which of the following statements about the Crime and Criminal Tracking Network System (CCTNS) is/are correct? 1. It will facilitate real time access of classified criminal data to the law enforcement authorities. 2. National Crime ... below- 1) 1 only 2) 2 only 3) Both 1 and 2 4) Neither 1 nor 2

Last Answer : 1) 1 only

Description : Consider the following statements: 1. Balaghat is known for its diamond mines. 2. Majhgawan is known for its manganese deposits. Which of the statements given above is/are correct? [IAS 2007] (a) 1 only (b) 2 only (c) Both 1 and 2 (d) Neither 1 nor 2

Last Answer : Ans: (d)

Description : Consider the following statements: 1. Gondwana coal is a laminated, bituminous coal. . 2. Gondwana coal is completely free from moisture, sulphur and phosphorus. Which of the statements given above is/are correct? [IAS 2008] (a) 1 only (b) 2 only (c) Both 1 and 2 (d) Neither 1 nor 2

Last Answer : Ans: (a)