Table One, containg the primary key
|
Table two, containing the foreign key
|
| These two tables contain information that relate to each other through the ID column. The table on the left contains the primary key of users who have made purchases. There are two columns stating the users name. The last column shows the total purchased dollars made by each particular person.
The table on the right contains the foreign keys, these have the same information in the ID column. The description column describes what product was purchased. The quantity column displays how much or a particular product was purchased. The last column displays the product price.
Execute QueryStart with opening a connection to the databse. Retrieve all relevant columns, in this case we retrieve all columns. Then being the query posed by the user. 1.) Anthony asks, "How much have I purchased?" 2.) Mike asks, "What have I purchased?" |