How many friends does Alice have?
SELECT count ( T2.friend )  FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name   =   T2.friend WHERE T2.name   =   'Alice'
counting Alice's friends refers to COUNT(T2.friend); a JOIN operation is used to link Person and PersonFriend tables on the condition that T1.name equals T2.friend; WHERE clause is used to filter records where T2.name is 'Alice';