InfyTQ Subquery Quiz 3

Question 1

Time: 00:00:00
SQL applies predicates in the _______ clause after groups have been formed, so aggregate functions may be used.

Group By

Group By

With

With

Where

Where

Having

Having

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
Aggregate functions can be used in the select list or the_______clause of a select statement or subquery. They cannot be used in a ______ clause.

Where, having

Where, having

Having, where

Having, where

Group by, having

Group by, having

Group by, where

Group by, where

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
The ________ keyword is used to access attributes of preceding tables or subqueries in the from clause.

In

In

Lateral

Lateral

Having

Having

With

With

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
WITH max_budget (VALUE) AS

(SELECT MAX(budget)

FROM department)

SELECT budget

FROM department, max_budget

WHERE department.budget = MAX budget.value;

In the query given above which one of the following is a temporary relation?

Budget

Budget

Department

Department

Value

Value

Max_budget

Max_budget

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
Subqueries cannot:

Use group by or group functions

Use group by or group functions

Retrieve data from a table different from the one in the outer query

Retrieve data from a table different from the one in the outer query

Join tables

Join tables

Appear in select, update, delete, insert statements

Appear in select, update, delete, insert statements

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
which of the following is not an aggregate function?

Avg

Avg

Sum

Sum

With

With

Min

Min

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
The EXISTS keyword will be true if:

 Any row in the subquery meets the condition only

 Any row in the subquery meets the condition only

All rows in the subquery fail the condition only

All rows in the subquery fail the condition only

Both of these two conditions are met

Both of these two conditions are met

Neither of these two conditions is met

Neither of these two conditions is met

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
How can you find rows that do not match some specified condition?

Exists

Exists

 Double use of NOT EXISTS

 Double use of NOT EXISTS

 NOT EXISTS

 NOT EXISTS

None of the mentioned

None of the mentioned

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
In the following Query, which of the following can be placed in the Query's blank portion to display the salary from highest to lowest amount, and sorting the employs name alphabetically?

  1. SELECT *  

  2. FROM instructor  

  3. ORDER BY salary ____, name ___;

Ascending, Descending

Ascending, Descending

Asc, Desc

Asc, Desc

Desc, Asc

Desc, Asc

All of the above

All of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
The given Query can be replaced with ____________:

  1. SELECT name  

  2. FROM instructor1   

  3. WHERE salary <= 100000 AND salary >= 90000;

  1. SELECT name  
  2. FROM instructor1  
  3. WHERE salary BETWEEN 100000 AND 90000

  1. SELECT name  
  2. FROM instructor1  
  3. WHERE salary BETWEEN 100000 AND 90000

  1. SELECT name  
  2. FROM instructor|  
  3. WHERE salary BETWEEN 90000 AND 100000;

  1. SELECT name  
  2. FROM instructor|  
  3. WHERE salary BETWEEN 90000 AND 100000;

  1. SELECT name  
  2. FROM instructor1  
  3. WHERE salary BETWEEN 90000 AND 100000;

  1. SELECT name  
  2. FROM instructor1  
  3. WHERE salary BETWEEN 90000 AND 100000;

  1. SELECT name  
  2. FROM instructor!  
WHERE salary <= 90000 AND salary>=100000;

  1. SELECT name  
  2. FROM instructor!  
WHERE salary <= 90000 AND salary>=100000;

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Completed

0/0

Accuracy

0%