SQL select statements with multiple tables

sql

Solution

Select * from people p, address a where  p.id = a.person_id and a.zip='97229';

Or you must TRY using `JOIN` which is a more efficient and better way to do this as Gordon Linoff in the comments below also says that you need to learn this.

SELECT p.*, a.street, a.city FROM persons AS p
JOIN address AS a ON p.id = a.person_id
WHERE a.zip = '97299';

Here `p.*` means it will show all the columns of PERSONS table.

Problem

Given the following two tables: ``` Person table id (pk) first middle last age Address table id(pk) person_id (fk person.id) street city state zip ``` How do I create an SQL statement that returns all information for people with zip code 97229?

Original source