CustomerID 1 2 3 4
CustomerID 1 2 3 4
CustomerID 1 2 3 4
626 222-
1 John Smith [email protected] 2/4/1968
2222
323 455-
2 Steven Goldfish [email protected] 4/4/1974
4545
416 323-
3 Paula Brown [email protected] 5/24/1978
3232
416 323-
4 James Smith [email protected] 2/10/1980
8888
Sales:
he SQL expression above will select all distinct customers (their first and last names) and the
total respective amount of dollars they have spent.
The SQL JOIN condition has been specified after the SQL WHERE clause and says that the 2
tables have to be matched by their respective CustomerID columns.