runtime
14 / 139

task TRIM / LOWER / SUBSTR / REPLACE · easy

People invited by several workspaces

Return email (lower-cased, trimmed invitee_email) and workspaces: the number of different workspaces that invited it, for emails invited by more than one workspace.

what to return

Columns
emailworkspaces in this order
Rows
38 rows · any order
Skill
Group on a normalized text key. Refresher: Clean strings & cast values →

expected result

Your query should return exactly these columns and values. Run it and compare.

expected result38 rows · any order
emailworkspaces
aaron.kaur@mail.example2
alex.shah@mail.example2
amara.chang@mail.example2

first 3 of 38 rows

data you can query

Product / SaaS Analytics dataset: the first 6 rows of each table. Under each column name: the kind of value it holds, and which table it links to. Your queries run on all rows.

invitations7 columns · 6,450 rows
invitation_idnumber · unique idaccount_idnumber · links to accountsinvited_by_user_idnumber · links to usersinvitee_emailtextsent_atdate & timeaccepted_atdate & timeaccepted_user_idnumber · links to users
111deepa.bell@ironcapital1.example2024-01-21 11:24:152024-01-24 03:43:142
211sofia.wilson@mail.example2024-02-02 07:45:532024-02-02 21:34:253
326nadia.flores@vectordata2.example2024-01-25 09:18:58NULLNULL
426rosa.jones@vectordata2.example2024-02-03 06:27:242024-02-03 07:03:467
5310raj.li@truefoods3.example2024-01-20 15:16:56NULLNULL
6310ayesha.silva@truefoods3.example2024-01-24 19:32:042024-01-26 05:58:0311
invitation_idnumber · unique id
1
account_idnumber · links to accounts
1
invited_by_user_idnumber · links to users
1
invitee_emailtext
deepa.bell@ironcapital1.example
sent_atdate & time
2024-01-21 11:24:15
accepted_atdate & time
2024-01-24 03:43:14
accepted_user_idnumber · links to users
2
invitation_idnumber · unique id
2
account_idnumber · links to accounts
1
invited_by_user_idnumber · links to users
1
invitee_emailtext
sofia.wilson@mail.example
sent_atdate & time
2024-02-02 07:45:53
accepted_atdate & time
2024-02-02 21:34:25
accepted_user_idnumber · links to users
3
invitation_idnumber · unique id
3
account_idnumber · links to accounts
2
invited_by_user_idnumber · links to users
6
invitee_emailtext
nadia.flores@vectordata2.example
sent_atdate & time
2024-01-25 09:18:58
accepted_atdate & time
NULL
accepted_user_idnumber · links to users
NULL
invitation_idnumber · unique id
4
account_idnumber · links to accounts
2
invited_by_user_idnumber · links to users
6
invitee_emailtext
rosa.jones@vectordata2.example
sent_atdate & time
2024-02-03 06:27:24
accepted_atdate & time
2024-02-03 07:03:46
accepted_user_idnumber · links to users
7
invitation_idnumber · unique id
5
account_idnumber · links to accounts
3
invited_by_user_idnumber · links to users
10
invitee_emailtext
raj.li@truefoods3.example
sent_atdate & time
2024-01-20 15:16:56
accepted_atdate & time
NULL
accepted_user_idnumber · links to users
NULL
invitation_idnumber · unique id
6
account_idnumber · links to accounts
3
invited_by_user_idnumber · links to users
10
invitee_emailtext
ayesha.silva@truefoods3.example
sent_atdate & time
2024-01-24 19:32:04
accepted_atdate & time
2024-01-26 05:58:03
accepted_user_idnumber · links to users
11

first 6 of 6,450 rows · your queries use all of them

solution.sql
 

Hints and the answer are always available. Using them counts the question as solved with help.

People invited by several workspaces — SQL practice · Runtime