2. The Basics of SQL for Analytics
Activity 2.01: Querying the customers Table Using Basic Keywords in a SELECT Query
Solution:
Here is the solution for Exercise 2.01, Running Your First SELECT Query:
- Open
pgAdmin
, connect to thesqlda
database, and open SQL query editor. Examine the schema for thecustomers
table from the schema drop-down list. Make sure you are familiar with the names of the columns, just like you did in Exercise 2.02, Querying the salespeople Table Using Basic Keywords in a SELECT Query, for thesalespeople
table. - Execute the following query to fetch customers' emails in the state of Florida in alphabetical order:
SELECT email FROM customers WHERE state='FL' ORDER BY email;
The following is the output of the preceding code:
- Execute the following query to pull all the first names, last names, and email addresses for ZoomZoom...