Explore BrainMass

Customer Name in Query Results

How come I get so many Smiths in this query (using the Week 2 lecture database)? There's only 26 orders and 4 customers named Smith. Yet I get 104 rows as a result?

SELECT orders.order_numb, customers.customer_last_name
FROM orders, customers
WHERE customers.customer_last_name like "smith";

© BrainMass Inc. brainmass.com June 21, 2018, 12:58 am ad1c9bdddf


Solution Preview

You should use inner join to get having matching records in both ...