What are the names of the patients who had more than one appointment?
select name from appointment as t1 join patient as t2 on t1.patient = t2.ssn group by t1.patient having count ( * ) > 1
What are their phone numbers, please?
select phone from appointment as t1 join patient as t2 on t1.patient = t2.ssn group by t1.patient having count ( * ) > 1
What are the pcp's of those patients?
select pcp from appointment as t1 join patient as t2 on t1.patient = t2.ssn group by t1.patient having count ( * ) > 1
What are the names of the patients who only had one appointment?
select name from appointment as t1 join patient as t2 on t1.patient = t2.ssn group by t1.patient having count ( * ) = 1
When did his appointment start and end?
select t1.start,t1.end from appointment as t1 join patient as t2 on t1.patient = t2.ssn group by t1.patient having count ( * ) = 1