## 2.5. Querying a Table

[]() []() To retrieve data from a table, the table is *queried*. An SQL `SELECT` statement is used to do this. The statement is divided into a select list (the part that lists the columns to be returned), a table list (the part that lists the tables from which to retrieve the data), and an optional qualification (the part that specifies any restrictions). For example, to retrieve all the rows of table `weather`, type:

```
SELECT * FROM weather;

```

 Here `*` is a shorthand for “all columns”. [<sup class="footnote" id="id-1.4.4.6.2.10">[2]</sup>](#ftn.id-1.4.4.6.2.10) So the same result would be had with:

```
SELECT city, temp_lo, temp_hi, prcp, date FROM weather;

```

 The output should be:

```
     city      | temp_lo | temp_hi | prcp |    date
