MySQL GROUP BY


  1. What is the significance of the statement “HAVING COUNT (emp_id)>2” in the given query?
    SELECT dep.name, COUNT (emp_id) emp_no
    FROM department dep INNER JOIN Employee em
    ON dep.dept_id=em.emp_id
    GROUP BY dep.name
    HAVING COUNT (emp_id) > 2











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    “HAVING” clause are worked similar as “WHERE” clause.


  1. What is the significance of the statement “GROUP BY d.name” in the given query?
    SELECT p.name, COUNT (emp_id) Per_no
    FROM Person p INNER JOIN Employee em
    ON p.per_id=em.emp_id
    GROUP BY p.name











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    “GROUP BY” clause s used for aggregation of field.



  1. Which clause is used with an “aggregate functions”?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    “GROUP BY” is used with aggregate functions.


  1. Which of the following belongs to an “aggregate function”?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    MIN/MAX, COUNT and SUM/AVG are belongs to an “aggregate function”.



  1. What is the meaning of “GROUP BY” clause in Mysql?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Group data by column values