<prompt> Kuandika C kazi ambayo maswali database SQL kutatua tatizo hili:Tuseme una meza inayoitwa wafanyakazi na safu wafanyakazi_id, jina, kuanza_tarehe, mshahara, na department_id. Kuandika SQL query kupata idara na mshahara wa juu wa wastani kwa kila mfanyakazi.  <response>: Heres a C function that queries an SQL database to solve the problem:include include using namespace std;void findHighestAvgSalaryPerEmployeeMYSQL conn MYSQL_RES res; MYSQL_ROW row; string query SELECT department_id, AVGsalary as avg_salary_per_employee FROM employees GROUP BY department_id ORDER BY avg_salary_per_employee DESC LIMIT 1; if mysql_queryconn, query.c_str cerr Error querying database: mysql_errorconn endl; mysql_closeconn; exit1; res mysql_use_resultconn; if res row mysql_fetch_rowres; cout Department with highest average salary per employee: row0 endl; else cerr Error getting result set: mysql_errorconn endl; mysql_closeconn; exit1; mysql_free_resultres;int main MYSQL conn mysql_initNULL; if conn NULL cerr Error initializing MySQL: mysql_errorconn endl; exit1; if mysql_real_connectconn, localhost, username, password, database, 3306, NULL, 0 NULL cerr Error connecting to database: mysql_errorconn endl; mysql_closeconn; exit1; findHighestAvgSalaryPerEmployeeconn; mysql_closeconn; return 0;This function uses the MySQL C Connector to connect to an SQL database and query the employees table for the department with the highest average salary per employee. It first builds a SQL query string that calculates the average salary per employee for each department, sorts the results in descending order by the average salary, and returns just the first row which will have the highest average. It then executes the query, retrieves the results, and outputs the department ID with the highest average salary per employee. 