Quiz Discussion

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

WITH max_budget (VALUE) AS
(SELECT MAX(budget)
FROM department)
SELECT budget
FROM department, max_budget
WHERE department.budget = MAX budget.value;

 

Course Name: SQL -Structured Query Language

  • 1]

    Budget

  • 2]

    Department

  • 3]

    Value

  • 4]

    Max_budget

Solution
No Solution Present Yet

Top 5 Similar Quiz - Based On AI&ML

Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api

# Quiz
1
Discuss

The EXISTS keyword will be true if:

  • 1]

    Any row in the subquery meets the condition only

  • 2]

    All rows in the subquery fail the condition only

  • 3]

    Both of these two conditions are met

  • 4]

    Neither of these two conditions is met

Solution
2
Discuss

Which of the following is not an aggregate function?

  • 1]

    Avg

  • 2]

    Sum

  • 3]

    With

  • 4]

    Min

Solution
3
Discuss
SELECT dept_name, ID, avg (salary)
FROM instructor
GROUP BY dept_name;
This statement IS erroneous because

 

  • 1]

    Avg(salary) should not be selected

  • 2]

    Dept_id should not be used in group by clause

  • 3]

    Misplaced group by clause

  • 4]

    Group by clause is not valid in this query

Solution
4
Discuss

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

  • 1]

    Group by

  • 2]

    With

  • 3]

    Where

  • 4]

    Having

Solution
5
Discuss

Which of the following creates a temporary relation for the query on which it is defined?

  • 1]

    With

  • 2]

    From

  • 3]

    Where

  • 4]

    Select

Solution
6
Discuss

Subqueries cannot:

  • 1]

    Use group by or group functions

  • 2]

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

  • 3]

    Join tables

  • 4]

    Appear in select, update, delete, insert statements.

Solution
7
Discuss

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

  • 1]

    EXISTS

  • 2]

    Double use of NOT EXISTS

  • 3]

    NOT EXISTS

  • 4]

    None of the mentioned

Solution
8
Discuss

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.

  • 1]

    Where, having

  • 2]

    Having, where

  • 3]

    Group by, having

  • 4]

    Group by, where

Solution
9
Discuss

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

  • 1]

    In

  • 2]

    Lateral

  • 3]

    Having

  • 4]

    With

Solution
# Quiz