Member-only story
SQL CRUD Basics Part 2 — Read
In SQL CRUD Basics Part 1 — Create, we learned how to create new rows of data in a database table with the INSERT
statement. In this post, we are going to visit the busiest statement in SQL — SELECT
. If you want to view or read the stored data in a table, you use SELECT
.
Note: All data, names or naming found within the database presented in this post, are strictly used for practice, learning, instruction, and testing purposes. It by no means depicts actual data belonging to or being used by any party or organization.
Self-Promotion:
If you enjoy the content written here, by all means, share this blog and your favorite post(s) with others who may benefit from or like it as well. Since coffee is my favorite drink, you can even buy me one if you would like!
For the most part, this post will utilize tables from the Sakila database which mimics a mock DVD rental store.
Below is the description of the ‘category’ table:
mysql> DESC category;
+ — — — — — — -+ — — — — — — — — — — -+ — — — + — — -+ — — — — — — — — — -+ — — — — — — — — — — — — — — — — — — — — — — — -+
| Field | Type | Null | Key | Default | Extra |
+ — — — — — — -+ — — — — — — — — — — -+ — — — + — — -+ — — — — — — — — — -+ — — — — — — — — — — — — — — — — — — — — — — — -+
| category_id | tinyint(3) unsigned |…