This lecture concludes the digital address book mini-project, focusing on querying.
Welcome to the second part of our mini-project. We have successfully created and populated our `Contacts` table. Now, let’s practice retrieving that information in useful ways using `SELECT` and `WHERE`.
Query 1: View All Contacts
First, let’s get a complete look at all the data in our address book. We use the simple `SELECT *` command for this.
SELECT * FROM Contacts;
This command will display all columns and all rows, giving you a full overview of your contacts.
Query 2: Get a List of Email Addresses
Imagine you want to send an email to all your contacts. You don’t need their physical addresses or phone numbers, just their first names and email addresses. You can select these specific columns.
SELECT FirstName, Email FROM Contacts;
This gives you a clean, two-column list, perfect for your purpose.
Query 3: Find a Specific Person
Now, let’s find the full record for John Smith. We need to use the `WHERE` clause to filter by his first and last name.
SELECT * FROM Contacts WHERE FirstName = 'John' AND LastName = 'Smith';
This query will return the single row containing all of John Smith’s information, from his ID to his address.
Query 4: Find Someone by Email
What if you know an email address but not the name? You can use the `WHERE` clause on the `Email` column.
SELECT * FROM Contacts WHERE Email = 'emily.jones@email.com';
This will retrieve the complete record for Emily Jones.
Project Complete!
Congratulations! You have successfully built a functional digital address book from scratch. You have designed a table, created it, inserted data, and written several queries to retrieve that data in meaningful ways.
You now have a solid understanding of the basic building blocks of a database.

In the Next Part of the Series…
We will move on to Core SQL in Action. We’ll learn how to modify and delete data that already exists in our tables using the UPDATE
and DELETE
commands, completing our mastery of the four essential CRUD (Create, Read, Update, Delete) operations.