Scenario: A DBA needs to find the average salary of all employees in a department. Which aggregation function should they use in DB2, and why?
- AVG()
- SUM()
- COUNT()
- MAX()
The correct option is AVG(). AVG() is used to calculate the average of a set of values. In this scenario, the DBA needs to find the average salary, which requires calculating the mean of all salaries in the department. SUM() calculates the total sum of values, COUNT() counts the number of rows, and MAX() returns the maximum value.
Loading...
Related Quiz
- How does DB2 handle invalid XML characters within tags?
- How can you verify the successful completion of the DB2 installation process?
- Third-party command line tools may offer specialized features for ________ tasks in DB2 administration.
- Scenario: A DBA is optimizing database performance in DB2 and considers using user-defined functions. How can UDFs contribute to performance tuning efforts?
- What is the primary goal of implementing high availability in a DB2 environment?