Describe how you would handle a SQL coding interview and a data analysis question in the same session.
Using the provided interview tables, write a query that identifies sessions containing both question types and summarizes how the session progressed. Include unanswered questions when counting question types, but calculate response metrics only from completed responses.
Output
- One row per qualifying session, with
session_id, sql_question_count, analysis_question_count, completed_response_count, avg_completed_response_seconds, first_question_type, and question_type_switches.
- Include only sessions containing at least one question of each type.
- Sort by
session_id ascending.
Output details
- Treat
sql_coding and data_analysis as the exact question-type values.
- Determine question order by
sequence_number ascending, breaking ties with question_id ascending.
- Round
avg_completed_response_seconds to two decimal places.
- Ignore NULL
response_seconds when averaging, while counting every response whose status is completed.
- Return NULL for
avg_completed_response_seconds when no completed response has a non-NULL duration.