SQLSQL LabPostgreSQL practice
00:0017 / 45
A05IntermediateCOUNT DISTINCT · joins

Event adoption by customer

Return customer_id, customer name, and event_types_used for customers using all five event types. Sort by customer_id.

Data available

Use these tables

2 tables · 1 relationship
Table 1

customers

Organizations using the deployed platform.

  • customer_idintegerPK
  • nametext
  • industrytext
  • regiontext
  • tiertext
  • onboarded_attimestamptz
Table 2

usage_events

Product events with late and duplicate source records.

  • event_idintegerPK
  • source_event_idtext
  • user_idintegerFK
  • customer_idintegerFK
  • event_typetext
  • occurred_attimestamptz
  • ingested_attimestamptz
  • duration_msintegerNULL
  • metadatajsonb
How the tables connect
usage_events.customer_id=customers.customer_id
Query editor

PostgreSQL

Run query
Result stream

Output

Run your query to inspect its result.
Contextual coach

Ask about this attempt

Run or check a query first. The coach only comments on a real error or grader mismatch.

Field notes

Hints & explanation

Try to solve it cold. Two progressive hints are available.