Blog

MCQs

Disclaimer:

Educational Use Only:

The website links provided are to be used strictly for educational and knowledge-gaining purposes only.

No Misuse:

Do not misuse the links or the information contained therein for any commercial, illegal, or unethical activities.

Respect for Websites and Businesses:

Respect the intellectual property and business interests of the websites and their owners. Do not attempt to alter, copy, or redistribute content without proper authorization.

Acknowledge Value of Knowledge:

Recognize and value the knowledge and resources shared by these websites. Use the information responsibly and ethically.

No Endorsement:

The provision of these links does not imply endorsement of the linked sites, their content, or their products and services. Users are responsible for evaluating the suitability and accuracy of the information.

User Responsibility:

By accessing these links, you agree to use the information at your own risk and to comply with all applicable laws and website terms of use.


Overall MCQs for Reference

  1. Which SQL clause filters results after the aggregation process?
    a. WHERE
    b. HAVING
    c. GROUP BY
    d. SELECT
    Answer: b. HAVINGsanfoundry+2​
  2. The HAVING clause is primarily used with which SQL clause?
    a. WHERE
    b. GROUP BY
    c. ORDER BY
    d. DISTINCT
    Answer: b. GROUP BYgeeksforgeeks+2​
  3. What is the main difference between HAVING and WHERE clauses?
    a. HAVING works with aggregated data, WHERE does not
    b. WHERE works with aggregated data, HAVING does not
    c. Both work with aggregated data
    d. Neither filters by aggregation
    Answer: a. HAVING works with aggregated data, WHERE does notw3schools+2​
  4. Which clause should appear after GROUP BY in an SQL query when using HAVING?
    a. WHERE
    b. SELECT
    c. HAVING
    d. FROM
    Answer: c. HAVINGsanfoundry+2​
  5. HAVING can be used with which statements?
    a. Only SELECT
    b. SELECT and GROUP BY
    c. SELECT and WHERE
    d. Any SQL statement
    Answer: b. SELECT and GROUP BYscribd+1​
  6. What role does HAVING play in AI-powered data analysis?
    a. Sorting numerical columns
    b. Filtering grouped results
    c. Managing data partitions
    d. Formatting output tables
    Answer: b. Filtering grouped resultschat2db+1​
  7. HAVING clause can use which types of operators for conditions?
    a. Only AND
    b. Only OR
    c. Both AND and OR
    d. None
    Answer: c. Both AND and ORscholarhat+1​
  8. When is HAVING preferred over WHERE for filtering?
    a. When filtering columns
    b. When filtering individual rows
    c. When filtering groups created by aggregation
    d. When formatting rows
    Answer: c. When filtering groups created by aggregationexamveda+1​
  9. Can HAVING be used without a GROUP BY clause?
    a. Yes
    b. No
    c. Only with WHERE
    d. Only with SELECT
    Answer: a. Yesgeeksforgeeks+1​
  10. HAVING filters grouped data using which type of condition?
    a. Aggregate conditions
    b. Column aliases
    c. Row indices
    d. Table partitions
    Answer: a. Aggregate conditionsgeeksforgeeks+1​
  11. The HAVING clause is essential in which kind of AI analytics task?
    a. Data encoding
    b. Cohort analysis
    c. Feature scaling
    d. Script execution
    Answer: b. Cohort analysischat2db​
  12. Which function is often used with HAVING for business intelligence?
    a. AVG()
    b. COUNT()
    c. SUM()
    d. All of the above
    Answer: d. All of the abovescholarhat+2​
  13. HAVING filters are applied at what stage of SQL query processing?
    a. Before WHERE clause
    b. After WHERE clause
    c. After aggregation
    d. Before SELECT
    Answer: c. After aggregationaws.amazon+2​
  14. HAVING can restrict results based on which SQL feature?
    a. Window functions
    b. Aggregate functions
    c. String comparisons
    d. Column names only
    Answer: b. Aggregate functionsw3schools+1​
  15. In AI-driven e-commerce analytics, HAVING is used to:
    a. Sort products alphabetically
    b. Filter products with few sales
    c. Format product descriptions
    d. Partition product databases
    Answer: b. Filter products with few saleschat2db​
  16. HAVING supports Boolean conditions. This means:
    a. It can use AND, OR, NOT
    b. It ignores logical operators
    c. It only supports AND
    d. It can only filter numerical data
    Answer: a. It can use AND, OR, NOTscholarhat+1​
  17. Which clause ensures filtering groups of data after grouping in AI systems?
    a. WHERE
    b. HAVING
    c. GROUP BY
    d. ORDER BY
    Answer: b. HAVINGgyansetu+1​
  18. HAVING works with which type of SQL functions?
    a. Scalar functions only
    b. Aggregate functions only
    c. Both scalar and aggregate
    d. None
    Answer: b. Aggregate functions onlygeeksforgeeks+1​
  19. In AI, HAVING helps identify customer segments by:
    a. Filtering non-aggregated data
    b. Filtering aggregated activity counts
    c. Sorting by region
    d. Encoding customer data
    Answer: b. Filtering aggregated activity countschat2db​
  20. Which query correctly uses HAVING in AI cohort analysis?
    a. SELECT * FROM user_activity HAVING COUNT() > 100;
    b. SELECT user_group, COUNT(
    ) FROM user_activity HAVING COUNT() > 100;
    c. SELECT user_group FROM user_activity WHERE COUNT(
    ) > 100;
    d. SELECT user_group FROM user_activity GROUP BY user_group;
    Answer: b. SELECT user_group, COUNT() FROM user_activity HAVING COUNT() > 100;chat2db​
  21. HAVING clause is executed in which order relative to GROUP BY?
    a. Before GROUP BY
    b. After GROUP BY
    c. Simultaneously
    d. Before WHERE
    Answer: b. After GROUP BYsanfoundry+1​
  22. HAVING can handle which advanced SQL feature for AI queries?
    a. Subqueries
    b. Only single value comparisons
    c. Index assignment
    d. Data partitioning
    Answer: a. Subquerieschat2db​
  23. Which clause would you use to apply a filter on SUM() in grouped data?
    a. WHERE
    b. HAVING
    c. ORDER BY
    d. SELECT
    Answer: b. HAVINGw3schools+1​
  24. HAVING is NOT used for which type of filtering?
    a. Row-level filtering before aggregation
    b. Grouped data after aggregation
    c. Filtering by computed totals
    d. Restricting by average values
    Answer: a. Row-level filtering before aggregationgeeksforgeeks+1​
  25. AI systems use HAVING in SQL for what business reporting function?
    a. Formatting tables
    b. Filtering sales groups by revenue
    c. Displaying all records
    d. Sorting columns
    Answer: b. Filtering sales groups by revenuechat2db​
  26. What does HAVING require if aggregate functions are involved?
    a. Explicit GROUP BY clause
    b. ORDER BY clause
    c. WHERE clause
    d. No clause
    Answer: a. Explicit GROUP BY clausescribd+1​
  27. HAVING supports which kind of logical grouping in AI analytics?
    a. Temporal
    b. Spatial
    c. Boolean
    d. None
    Answer: c. Booleanscholarhat+1​
  28. HAVING can be used to filter results where COUNT(*) is:
    a. Greater than a value
    b. Less than a value
    c. Equal to a value
    d. All of the above
    Answer: d. All of the abovegeeksforgeeks+1​
  29. Why was the HAVING clause added to SQL?
    a. For performance optimization
    b. Because WHERE cannot filter aggregates
    c. To replace SELECT
    d. For compatibility with NoSQL
    Answer: b. Because WHERE cannot filter aggregatesmultiple-choice-questions.blogspot+1​
  30. HAVING is most effective for filtering:
    a. Non-grouped rows
    b. Groups created after aggregation
    c. Table schemas
    d. Index trees
    Answer: b. Groups created after aggregationsanfoundry+1​
  31. In a financial AI report, HAVING identifies clients whose total transactions:
    a. Are below a threshold
    b. Meet a specific range
    c. Are above a limit
    d. All of the above
    Answer: d. All of the abovechat2db​
  32. HAVING can be used for which aggregate condition?
    a. SUM > value
    b. AVG < value
    c. COUNT = value
    d. All of the above
    Answer: d. All of the abovescholarhat+1​
  33. In SQL for AI, HAVING can restrict output if:
    a. The sum of a column exceeds a value
    b. The average is below a value
    c. The count matches a value
    d. All of the above
    Answer: d. All of the abovegeeksforgeeks+1​
  34. In cohort identification, HAVING filters user groups with:
    a. More than a specific number of users
    b. Less than a specific number of users
    c. Exactly a specific number of users
    d. All of the above
    Answer: d. All of the abovechat2db​
  35. HAVING clause accepts which condition types?
    a. Mathematical
    b. Logical
    c. Both mathematical and logical
    d. None
    Answer: c. Both mathematical and logicalgeeksforgeeks+1​
  36. In AI, HAVING is most useful when data is:
    a. Unaggregated
    b. Grouped and aggregated
    c. Static
    d. Partitioned
    Answer: b. Grouped and aggregatedgeeksforgeeks+1​
  37. Which AI analytics application uses HAVING for user segmentation?
    a. Forecasting
    b. Cohort analysis
    c. Feature selection
    d. Data labeling
    Answer: b. Cohort analysischat2db​
  38. Which is a correct HAVING clause in AI financial reporting?
    a. HAVING SUM(transactions) > 100000
    b. HAVING WHERE SUM(transactions) > 100000
    c. WHERE SUM(transactions) > 100000
    d. GROUP BY SUM(transactions) > 100000
    Answer: a. HAVING SUM(transactions) > 100000scholarhat+1​
  39. HAVING filters are evaluated:
    a. Before GROUP BY
    b. After aggregation
    c. Before SELECT
    d. Before WHERE
    Answer: b. After aggregationaws.amazon+2​
  40. Which clause can HAVING NOT be combined directly with?
    a. SELECT
    b. GROUP BY
    c. ORDER BY
    d. None
    Answer: d. Nonescribd+1​
  41. HAVING in AI can use which aggregate functions for filtering?
    a. SUM
    b. AVG
    c. COUNT
    d. All of the above
    Answer: d. All of the abovegeeksforgeeks+1​
  42. HAVING is useful in AI for trend analysis because:
    a. It filters summary-level data
    b. It encodes database columns
    c. It formats output tables
    d. It re-indexes rows
    Answer: a. It filters summary-level datamilvus+1​
  43. Which clause precedes HAVING in a standard SQL analytic query?
    a. GROUP BY
    b. ORDER BY
    c. SELECT
    d. WHERE
    Answer: a. GROUP BYsanfoundry+1​
  44. A HAVING clause can contain which of the following?
    a. Aggregate function conditions
    b. Table structure definitions
    c. Index creation statements
    d. None
    Answer: a. Aggregate function conditionsscholarhat+1​
  45. HAVING can be applied to grouped data in which scenario?
    a. Total count of group members exceeds a value
    b. Average value per group is above a threshold
    c. Sum of group attribute meets certain limit
    d. All of the above
    Answer: d. All of the abovescholarhat+1​
  46. HAVING is appropriate in AI queries when:
    a. Filtering grouped, aggregated results
    b. Filtering raw, row-level data
    c. Formatting outputs
    d. None of the above
    Answer: a. Filtering grouped, aggregated resultsgeeksforgeeks+1​
  47. HAVING is used with which SQL keywords in AI analytics?
    a. GROUP BY and aggregate functions
    b. ONLY WHERE and SELECT
    c. Only with window functions
    d. None
    Answer: a. GROUP BY and aggregate functionsscribd+1​
  48. HAVING can restrict groups in AI when:
    a. Aggregate calculations meet a condition
    b. Row-level values match a condition
    c. Table schema requires partitioning
    d. Data types are string only
    Answer: a. Aggregate calculations meet a conditionscholarhat+1​
  49. Using HAVING with subqueries in AI allows for:
    a. Comparing aggregate results with global data
    b. Formatting columns dynamically
    c. Partitioning database tables
    d. Relabeling attributes
    Answer: a. Comparing aggregate results with global datachat2db​
  50. Which statement about HAVING and WHERE in AI data applications is true?
    a. HAVING filters groups post-aggregation; WHERE filters rows pre-aggregation
    b. WHERE filters only aggregate data
    c. HAVING replaces WHERE
    d. HAVING is used for table formatting
    Answer: a. HAVING filters groups post-aggregation; WHERE filters rows pre-aggregationw3schools+1​
  1. https://www.sanfoundry.com/sql-questions-answers-sql-having-clause/
  2. https://hightouch.com/sql-dictionary/sql-having
  3. https://www.w3schools.com/sql/sql_having.asp
  4. https://www.geeksforgeeks.org/sql/sql-having-clause-with-examples/
  5. https://www.scholarhat.com/tutorial/sqlserver/sql-having-clause
  6. https://www.scribd.com/document/790797022/SQL-MCQ-Questions
  7. https://chat2db.ai/resources/blog/having-clause-in-sql-for-data-filtering
  8. https://www.examveda.com/the-having-clause-does-which-of-the-following-24073/
  9. https://www.geeksforgeeks.org/questions/which-of-the-following-statements-are-true-about-an/
  10. https://docs.aws.amazon.com/kinesisanalytics/latest/sqlref/sql-reference-having-clause.html
  11. https://www.gyansetu.in/blog/sql-query-mcq-quiz-with-answers/
  12. https://multiple-choice-questions.blogspot.com/2015/08/questions-sql-group-by-having.html
  13. https://milvus.io/ai-quick-reference/how-do-you-use-the-having-clause-in-sql
  14. https://www.sanfoundry.com/sql-mcqs-group-by-having-clause/
  15. https://www.scribd.com/document/910261440/SQL-Database-MCQs-Job-Exam
  16. https://stackoverflow.com/questions/14756222/multiple-aggregate-functions-in-having-clause
  17. https://www.igmguru.com/blog/sql-mcqs
  18. https://herovired.com/learning-hub/blogs/having-clause-in-sql/
  19. https://www.placementpreparation.io/mcq/sql/
  20. https://learn.microsoft.com/en-us/ssms/visual-db-tools/use-having-and-where-clauses-in-the-same-query-visual-database-tools

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!