-- Retrieving data for a specific passenger complaint:
SELECT
    c.id AS complaint_id,
    r.id AS ride_id,
    p.id AS passenger_id,
    p.first_name,
    p.last_name,
    p.phone,
    p.email,
    c.complaint_type,
    c.description,
    c.date_filed,
    c.statusComplaint AS complaint_status,
    c.resolution,
    c.date_resolved
FROM
    complaint c
JOIN ride r ON
    c.ride_id = r.id
JOIN `passengers` p ON
    c.passenger_id = p.id
WHERE
    c.complaint_type = 'Passenger' AND c.passenger_id = '100393163265770158312';