Suppose I have two SQL tables: Customers and PhoneNumbers.
Suppose that Customers has the following columns: customerId (primary key), fName, lName.
Suppose that PhoneNumbers has the following columns: phoneNumberId (primary key), phoneNumber, customerId (foreign key).
What I understand so far is that if each customer has one phone number, I can select the fName, lName, and phoneNumber of each customer with the following SQL:
SELECT
customer.fName, customer.lName, phone.phoneNumber
FROM
Customers customer
INNER JOIN phoneNumbers phone ON
customer.customerId = phone.customerId
What if a customer may have more than one phone number? How do I get a list of customers with the list of phone numbers of each customer?
My programming language to drive the SQL is C#/.NET.