Preview:
SELECT DISTINCT
  u.id AS student_id,
  u.firstname AS student_firstname,
  u.lastname AS student_lastname,
  u.phone AS student_phone,
  up.country AS student_country,
  parent_user.id AS parent_id,
  parent_user.firstname AS parent_firstname,
  parent_user.lastname AS parent_lastname,
  parent_user.phone AS parent_phone,
  parent_profile.country AS parent_country,
  p.status AS relationship_status,
  u.created_at AS student_signup_unix
FROM user u
LEFT JOIN user_profile up ON u.id = up.user_id
LEFT JOIN parents p ON p.student_id = u.id
LEFT JOIN user parent_user ON parent_user.id = p.parent_id
LEFT JOIN user_profile parent_profile ON parent_profile.user_id = p.parent_id
WHERE u.type = 'student'
  AND u.created_at BETWEEN 1740783600 AND 1743375600
  AND (
    COALESCE(up.country, '') IN ('united-kingdom', 'United Kingdom') OR 
    COALESCE(parent_profile.country, '') IN ('united-kingdom', 'United Kingdom') OR
    u.phone LIKE '44%' OR
    parent_user.phone LIKE '44%'
  );
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter