A JOIN clause is used to combine rows from two or more tables, based on a related column
between them.
Select my_contacts.last_name, first_name, email, interests.interest
From my_contacts
Join contact_interest on my_contacts.contact_id = contact_interest.contact_id
Join interests on contact_interest.interest_id = interests.interest_id
Order by my_contacts.last_name;
Select count(status) as ‘total married’ from my_contacts
Join status on my_contacts.status_id = status.status
Where status = ‘married’;
select my_contacts.last_name, first_name, email, status.status, seeking.seeking from my_contacts
join status on status.status_id = my_contacts.status_id
join contact_interest on my_contacts.contact_id = contact_interest.contact_id
join interests on interests.interest_id = contact_interest.interest_id
join contact_seeking on my_contacts.contact_id = contact_seeking.contact_id
where interests.interest = ‘fishing’
order by my_contacts.last_name;