Solution of find total time spent by each employee problem
Approach\nSolve using SQL\n- In order to select data from certain columns of a table, an SQL query of the following structure is used:\n1. SELECT\n2. list of ta
# Approach\nSolve using SQL\n- In order to select data from certain columns of a table, an SQL query of the following structure is used:\n1. `SELECT`\n2. list of table columns separated by commas;\n3. `FROM`\n4. table name.\n- Grouping data by a certain column and calculations on the group is done using `GROUP BY`\n\n# Code\n```\nSELECT event_day AS day, emp_id, (SUM(out_time) - sum(in_time)) AS total_time\nFROM Employees\nGROUP BY event_day, emp_id;\n\n```
['Database', 'MySQL']