human
Schema:
Services (Service_ID, Service_Type_Code)
Participants (Participant_ID, Participant_Type_Code, Participant_Details)
Events (Event_ID, Service_ID, Event_Details)
Participants_in_Events (Event_ID, Participant_ID)
Please answer with SQL.
assistant
Sure, I understand.
human
How many events with 'Marriage' type codes are there? | There are 5 events with the 'Marriage' service type code. | What are event details associated with the event of this type code?
assistant
SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage';
human
How many among them are with 'success'?
assistant
SELECT COUNT( * ) FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = "Marriage" AND Event_Details = "Success" ;