SlideShare a Scribd company logo
Creation Date: March 28th 2023
Author: Magnus Skonberg
SAMPLE SQL SCREENING
Purpose: inspect the tables and write SQL queries to answer the questions provided below.
…
Tables
Event Log
event_id employee_id customer_id event timestamp
1 1 1 Check in 2023-03-01 08:03:54
2 2 2 Check In 2023-03-01 09:17:32
3 1 1 Complete 2023-03-01 11:33:00
4 1 3 Check in 2023-03-01 12:27:00
5 1 1 Issue PO 2023-03-01 13:15:33
6 1 3 Complete 2023-03-01 16:11:11
7 2 2 Complete 2023-03-01 17:35:11
8 2 2 Issue PO 2023-03-02 06:52:22
9 1 3 Issue PO 2023-03-02 07:58:23
10 1 4 Check in 2023-03-02 08:17:16
11 1 4 Complete 2023-03-02 15:56:45
12 1 4 Issue PO 2023-03-02 16:22:12
Employees
emp_id name position salary
1 Willy Washington Analyst 20500
2 Avery Adams Analyst 18600
3 Jenny Jefferson Analyst 19900
4 Laura Lincoln Consultant 15700
5 Ricky Roosevelt Consultant 14550
6 Ellis Eisenhower Consultant 17800
7 Jimmy Johnson Sales 12000
8 Barbara Bush Sales 256000
9 Orville Obama Sales 14800
…
Creation Date: March 28th 2023
Author: Magnus Skonberg
Questions
Q1 How many different events have been logged? And what’s the most popular `event`?
Q2 On which date were the most customers serviced?
Q3 What’s the name of the employee responsible for the most events? (How) would our results
differ if we used a left vs. inner join?
Q4 What’s the average employee salary per position? And where does each employee rank
with regard to salary for their position?
Q5 What job (employee_id + customer_id) took the longest to complete? And how long did it
take?
…
Creation Date: March 28th 2023
Author: Magnus Skonberg
Solutions
Q1 How many different events have been logged? And what’s the most popular `event`?
SELECT COUNT(*)
FROM event;
SELECT
event,
COUNT(*)
FROM event
GROUP BY 1
ORDER BY 2 DESC;
Answer: 12 events have been logged. All events have occurred at the same frequency. Thus,
there is no “most popular” event.
…
Q2 On which date were the most customers serviced?
SELECT
DATE_TRUNC('day', start_time) as start_date,
COUNT(DISTINCT customer_id) as customers_serviced
FROM event
GROUP BY 1
ORDER BY 2 DESC;
Answer: I took “serviced” to mean that some work function, including issuing the PO, was
completed. As such, the dates had an equivalent number of customers serviced. 3 customers
were serviced on the 1st and 2nd of March 2023.
…
Q3 What’s the name of the employee responsible for the most events? (How) would our results
differ if we used a left vs. inner join?
SELECT
e1.name,
COUNT(*) as events
FROM employees e1
INNER JOIN event e2
ON e1.emp_id = e2.employee_id
GROUP BY 1
Creation Date: March 28th 2023
Author: Magnus Skonberg
ORDER BY 2 DESC;
Answer: Willy Washington was responsible for the most events with 9.
In this particular instance, a LEFT JOIN would return all names from the employees table
whereas an INNER JOIN would only return names with entries in the events table. While the
outcome / top entry would be the same with either join, the subsequent entries would differ and
could be misinterpreted. As such, we go with and recommend an INNER JOIN.
…
Q4 What’s the average employee salary per position? And where does each employee rank
with regard to salary for their position?
SELECT *,
ROUND(AVG(salary) OVER(PARTITION BY position),2) AS average_position_salary,
RANK() OVER(PARTITION BY position ORDER BY salary DESC) AS
position_salary_rank
FROM employees;
…
Q5 What job (employee_id + customer_id) took the longest to complete? And how long did it
take?
WITH duration AS (
SELECT
*,
LEAD(start_time) OVER(PARTITION BY employee_id, customer_id ORDER BY
start_time) as end_time,
LEAD(start_time) OVER(PARTITION BY employee_id, customer_id ORDER BY
start_time) - start_time as duration
FROM event
Creation Date: March 28th 2023
Author: Magnus Skonberg
)
SELECT
employee_id,
customer_id,
SUM(duration) as total_duration
FROM duration
GROUP BY 1,2
ORDER BY 3 DESC;
Answer: the job with employee_id 2 and customer_id 2 took the longest, with a total duration of
21 hours 34 minutes and 50 seconds.

More Related Content

Similar to SAMPLE SQL SCREENING

ADBMS ASSIGNMENT
ADBMS ASSIGNMENTADBMS ASSIGNMENT
ADBMS ASSIGNMENT
Lori Moore
 
CMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportCMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End Report
Matthew Zackschewski
 
ACL London User Group - Question Box Session
ACL London User Group - Question Box SessionACL London User Group - Question Box Session
ACL London User Group - Question Box Session
Alex Psarras
 
IntroductionIn this assignment, you will learn about bonds and t.docx
IntroductionIn this assignment, you will learn about bonds and t.docxIntroductionIn this assignment, you will learn about bonds and t.docx
IntroductionIn this assignment, you will learn about bonds and t.docx
mariuse18nolet
 
CASE STUDY 3- NEW PROJECT
CASE STUDY 3- NEW PROJECTCASE STUDY 3- NEW PROJECT
CASE STUDY 3- NEW PROJECT
Temitayo Bamitogba
 
Managing EMS in Chronicle
Managing EMS in ChronicleManaging EMS in Chronicle
Managing EMS in Chronicle
Eric S. Lavelle
 
3Big Data Analyst QuestionnaireWithin this document are fo.docx
3Big Data Analyst QuestionnaireWithin this document are fo.docx3Big Data Analyst QuestionnaireWithin this document are fo.docx
3Big Data Analyst QuestionnaireWithin this document are fo.docx
lorainedeserre
 
Calendarsnack 2021 FAQS
Calendarsnack 2021 FAQSCalendarsnack 2021 FAQS
Calendarsnack 2021 FAQS
31events.com
 
DZ04-Program narrative_R1
DZ04-Program narrative_R1DZ04-Program narrative_R1
M|18 Analytics in the Real World, Case Studies and Use Cases
M|18 Analytics in the Real World, Case Studies and Use CasesM|18 Analytics in the Real World, Case Studies and Use Cases
M|18 Analytics in the Real World, Case Studies and Use Cases
MariaDB plc
 

Similar to SAMPLE SQL SCREENING (10)

ADBMS ASSIGNMENT
ADBMS ASSIGNMENTADBMS ASSIGNMENT
ADBMS ASSIGNMENT
 
CMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportCMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End Report
 
ACL London User Group - Question Box Session
ACL London User Group - Question Box SessionACL London User Group - Question Box Session
ACL London User Group - Question Box Session
 
IntroductionIn this assignment, you will learn about bonds and t.docx
IntroductionIn this assignment, you will learn about bonds and t.docxIntroductionIn this assignment, you will learn about bonds and t.docx
IntroductionIn this assignment, you will learn about bonds and t.docx
 
CASE STUDY 3- NEW PROJECT
CASE STUDY 3- NEW PROJECTCASE STUDY 3- NEW PROJECT
CASE STUDY 3- NEW PROJECT
 
Managing EMS in Chronicle
Managing EMS in ChronicleManaging EMS in Chronicle
Managing EMS in Chronicle
 
3Big Data Analyst QuestionnaireWithin this document are fo.docx
3Big Data Analyst QuestionnaireWithin this document are fo.docx3Big Data Analyst QuestionnaireWithin this document are fo.docx
3Big Data Analyst QuestionnaireWithin this document are fo.docx
 
Calendarsnack 2021 FAQS
Calendarsnack 2021 FAQSCalendarsnack 2021 FAQS
Calendarsnack 2021 FAQS
 
DZ04-Program narrative_R1
DZ04-Program narrative_R1DZ04-Program narrative_R1
DZ04-Program narrative_R1
 
M|18 Analytics in the Real World, Case Studies and Use Cases
M|18 Analytics in the Real World, Case Studies and Use CasesM|18 Analytics in the Real World, Case Studies and Use Cases
M|18 Analytics in the Real World, Case Studies and Use Cases
 

Recently uploaded

4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
hyfjgavov
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
slg6lamcq
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
apvysm8
 
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
xclpvhuk
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
SaffaIbrahim1
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
AndrzejJarynowski
 
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
wyddcwye1
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
nuttdpt
 
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Kaxil Naik
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
Timothy Spann
 
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
z6osjkqvd
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
Bill641377
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
nuttdpt
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
aqzctr7x
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
Walaa Eldin Moustafa
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
Márton Kodok
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Kiwi Creative
 
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
taqyea
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
bmucuha
 

Recently uploaded (20)

4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
 
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
 
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
 
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
 
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
一比一原版英属哥伦比亚大学毕业证(UBC毕业证书)学历如何办理
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
 
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(harvard毕业证书)哈佛大学毕业证如何办理
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 

SAMPLE SQL SCREENING

  • 1. Creation Date: March 28th 2023 Author: Magnus Skonberg SAMPLE SQL SCREENING Purpose: inspect the tables and write SQL queries to answer the questions provided below. … Tables Event Log event_id employee_id customer_id event timestamp 1 1 1 Check in 2023-03-01 08:03:54 2 2 2 Check In 2023-03-01 09:17:32 3 1 1 Complete 2023-03-01 11:33:00 4 1 3 Check in 2023-03-01 12:27:00 5 1 1 Issue PO 2023-03-01 13:15:33 6 1 3 Complete 2023-03-01 16:11:11 7 2 2 Complete 2023-03-01 17:35:11 8 2 2 Issue PO 2023-03-02 06:52:22 9 1 3 Issue PO 2023-03-02 07:58:23 10 1 4 Check in 2023-03-02 08:17:16 11 1 4 Complete 2023-03-02 15:56:45 12 1 4 Issue PO 2023-03-02 16:22:12 Employees emp_id name position salary 1 Willy Washington Analyst 20500 2 Avery Adams Analyst 18600 3 Jenny Jefferson Analyst 19900 4 Laura Lincoln Consultant 15700 5 Ricky Roosevelt Consultant 14550 6 Ellis Eisenhower Consultant 17800 7 Jimmy Johnson Sales 12000 8 Barbara Bush Sales 256000 9 Orville Obama Sales 14800 …
  • 2. Creation Date: March 28th 2023 Author: Magnus Skonberg Questions Q1 How many different events have been logged? And what’s the most popular `event`? Q2 On which date were the most customers serviced? Q3 What’s the name of the employee responsible for the most events? (How) would our results differ if we used a left vs. inner join? Q4 What’s the average employee salary per position? And where does each employee rank with regard to salary for their position? Q5 What job (employee_id + customer_id) took the longest to complete? And how long did it take? …
  • 3. Creation Date: March 28th 2023 Author: Magnus Skonberg Solutions Q1 How many different events have been logged? And what’s the most popular `event`? SELECT COUNT(*) FROM event; SELECT event, COUNT(*) FROM event GROUP BY 1 ORDER BY 2 DESC; Answer: 12 events have been logged. All events have occurred at the same frequency. Thus, there is no “most popular” event. … Q2 On which date were the most customers serviced? SELECT DATE_TRUNC('day', start_time) as start_date, COUNT(DISTINCT customer_id) as customers_serviced FROM event GROUP BY 1 ORDER BY 2 DESC; Answer: I took “serviced” to mean that some work function, including issuing the PO, was completed. As such, the dates had an equivalent number of customers serviced. 3 customers were serviced on the 1st and 2nd of March 2023. … Q3 What’s the name of the employee responsible for the most events? (How) would our results differ if we used a left vs. inner join? SELECT e1.name, COUNT(*) as events FROM employees e1 INNER JOIN event e2 ON e1.emp_id = e2.employee_id GROUP BY 1
  • 4. Creation Date: March 28th 2023 Author: Magnus Skonberg ORDER BY 2 DESC; Answer: Willy Washington was responsible for the most events with 9. In this particular instance, a LEFT JOIN would return all names from the employees table whereas an INNER JOIN would only return names with entries in the events table. While the outcome / top entry would be the same with either join, the subsequent entries would differ and could be misinterpreted. As such, we go with and recommend an INNER JOIN. … Q4 What’s the average employee salary per position? And where does each employee rank with regard to salary for their position? SELECT *, ROUND(AVG(salary) OVER(PARTITION BY position),2) AS average_position_salary, RANK() OVER(PARTITION BY position ORDER BY salary DESC) AS position_salary_rank FROM employees; … Q5 What job (employee_id + customer_id) took the longest to complete? And how long did it take? WITH duration AS ( SELECT *, LEAD(start_time) OVER(PARTITION BY employee_id, customer_id ORDER BY start_time) as end_time, LEAD(start_time) OVER(PARTITION BY employee_id, customer_id ORDER BY start_time) - start_time as duration FROM event
  • 5. Creation Date: March 28th 2023 Author: Magnus Skonberg ) SELECT employee_id, customer_id, SUM(duration) as total_duration FROM duration GROUP BY 1,2 ORDER BY 3 DESC; Answer: the job with employee_id 2 and customer_id 2 took the longest, with a total duration of 21 hours 34 minutes and 50 seconds.