13.3 Selecting Data from Tables
Now that we have some data in our table, we can retrieve it using the SELECT statement. Here's how to retrieve all data from the 'Books' table:
The * symbol is a wildcard that means "all columns". This statement will return every row from every column in the 'Books' table. The output would be:
If we only want to select data from certain columns, we can specify those columns instead of using *. For example, to select only the 'Title' and 'Author' columns, we can use the following statement:
This will return:
The SELECT statement can be used with a variety of clauses to filter and sort the returned data, which we'll explore more in the following sections. For now, try creating your own tables, inserting data, and selecting data. This will solidify your understanding of these fundamental SQL operations.