Cover by Lynn Beighley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Chapter 2. The SELECT Statement: Gifted data retrieval

image with no caption

Is it really better to give than retrieve? When it comes to databases, chances are you’ll need to retrieve your data as often than you’ll need to insert it. That’s where this chapter comes in: you’ll meet the powerful SELECT statement and learn how to gain access to that important information you’ve been putting in your tables. You’ll even learn how to use WHERE, AND, and OR to selectively get to your data and even avoid displaying the data that you don’t need.

Date or no date?

Greg’s finished adding all the sticky notes into his my_contacts table. Now he’s ready to relax. He’s got two tickets to a concert, and he wants to ask one of his contacts, a girl from San Francisco, out on a date.

He needs to find her email address, so he uses the SELECT statement from Chapter 1 to view his table.

SELECT * from my_contacts;
image with no caption
image with no caption

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required