PROMPT bname ACCEPT 'Please enter part of the branch name: ';

SELECT RPAD(Name, 30) As "Name",
RPAD(COUNT(Customer.SSN), 13) As "CustomerCount"
FROM Branch, Customer
WHERE Customer.SSN IN (
      SELECT CustID 
      FROM T_c, T_b
      WHERE T_c.TransID = T_b.TransID
            AND T_b.BranchID = Branch.ID)
GROUP BY Name
HAVING LOWER(Name) LIKE '%&bname%';
