Introduction
So far, whenever we have wanted to see the results, we have used the Select *
syntax either by entering that query directly, or by generating it using the appropriate option in the application's menu. This displayed the entire table. However, when we want to retrieve data from the database, we are often not interested in the entire dataset; we are only looking for specific details. For example, the Packt database contains details of all the books published by Packt. It might include columns such as Book Name, ISBN, Author Name, Author ID, Author Email, Page Count, and Price. But if we wanted to send out a survey to all the authors who have written for Packt, all we would require is the author's name and their email address:
This is all we require:
Queries help us do just this. Using the SELECT
statement, we can pick...