SELECT library.dbo.adult.member_no, COUNT(library.dbo.juvenile.member_no) as numkids
FROM library.dbo.adult
JOIN library.dbo.juvenile ON library.dbo.juvenile.adult_member_no = library.dbo.adult.member_no
WHERE state = 'AZ'
GROUP BY library.dbo.adult.member_no
HAVING COUNT(juvenile.member_no) > 2
UNION
SELECT library.dbo.adult.member_no, COUNT(library.dbo.juvenile.member_no) as numkids
FROM library.dbo.adult
JOIN library.dbo.juvenile ON library.dbo.juvenile.adult_member_no = library.dbo.adult.member_no
WHERE state = 'CA'
GROUP BY library.dbo.adult.member_no
HAVING COUNT(juvenile.member_no) > 3;