runtime
14 / 139

task TRIM / LOWER / SUBSTR / REPLACE · easy

People invited by several workspaces

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

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

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

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
7415ava.morales@mail.example2024-02-01 23:08:41NULLNULL
8415rebecca.anderson@mail.example2024-02-09 00:04:332024-02-09 00:58:0116
9519rana.nguyen+work@prismhealth5.example2024-01-28 13:07:282024-01-28 19:27:5120
10519abigail.price@prismhealth5.example2024-02-01 07:22:28NULLNULL
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
invitation_idnumber · unique id
7
account_idnumber · links to accounts
4
invited_by_user_idnumber · links to users
15
invitee_emailtext
ava.morales@mail.example
sent_atdate & time
2024-02-01 23:08:41
accepted_atdate & time
NULL
accepted_user_idnumber · links to users
NULL
invitation_idnumber · unique id
8
account_idnumber · links to accounts
4
invited_by_user_idnumber · links to users
15
invitee_emailtext
rebecca.anderson@mail.example
sent_atdate & time
2024-02-09 00:04:33
accepted_atdate & time
2024-02-09 00:58:01
accepted_user_idnumber · links to users
16
invitation_idnumber · unique id
9
account_idnumber · links to accounts
5
invited_by_user_idnumber · links to users
19
invitee_emailtext
rana.nguyen+work@prismhealth5.example
sent_atdate & time
2024-01-28 13:07:28
accepted_atdate & time
2024-01-28 19:27:51
accepted_user_idnumber · links to users
20
invitation_idnumber · unique id
10
account_idnumber · links to accounts
5
invited_by_user_idnumber · links to users
19
invitee_emailtext
abigail.price@prismhealth5.example
sent_atdate & time
2024-02-01 07:22:28
accepted_atdate & time
NULL
accepted_user_idnumber · links to users
NULL

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

solution.sql
 
Output

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

People invited by several workspaces — SQL practice · Runtime