A Brief Introduction to SQL
Relational databases have a specialized language, called SQL (Structured Query Language), that is used for creating, reading, updating, and deleting records. The basics of SQL are straightforward and, in my opinion, pretty fun. SQL consists of structured queries (hence the name), and the structure is well defined. To read from the database, your query must start with the word SELECT, must declare which fields you want to read (use * if you want all fields), and must contain the name of the table you want to read from. Listing 5.21 fetches all fields from the Author table.
Note
The following code examples will work only if you are interacting with a real database. If you want practice writing SQL queries that will ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access