SELECT 
	firstname, lastname, gender, idnumber, birth_date, training_level, curriculum_vitae, certificate, guarantor1, guarantor2, facility1, facility2, createdby, lastmodifiedby 
FROM 
	trainers;
    
SELECT
	user_id, phone_number1, phone_number2, email, postal_number, postal_code, postal_town, county, ward, prof_picture, website, createdby, lastmodifiedby
FROM
	contacts;
    
SELECT 
	reference_type, reference_id, email, username, password
FROM
	system_users;

SELECT
                    trainers.id AS id,
                    trainers.firstname AS firstname,
                    trainers.lastname AS lastname,
                    trainers.facility1 AS facility1,
                    trainers.facility2 AS facility2,
                    trainers.sport AS sport_id,
                    trainers.gender AS gender,
                    trainers.location AS location,
                    trainers.trainer_rating AS trainer_ratings,
                    contacts.prof_picture AS profile_picture,
                    contacts.email AS email,
                    contacts.phone_number1 AS phone_number1,
                    contacts.phone_number2 AS phone_number2,
                    contacts.ward AS ward,
                    trainers.training_level AS training_level,
                    lesson_categories.name AS sport,
                    lesson_categories.base_price AS base_price
                  FROM contacts
                  JOIN trainers 
                    ON trainers.id=contacts.user_id
                  JOIN lesson_categories
                    ON trainers.sport=lesson_categories.id
                  WHERE trainers.id='2'