SQL operations and syntax
SQL is a powerful and expressive language for doing mass manipulations of tabular data, but the basics can be grasped quickly. SQL code is executed as individual queries that either define, manipulate, or select data in the database. SQL dialects vary somewhat between different relational database products, but most of them support ANSI/ISO-standard SQL for core operations.
While most of the basic concepts and keywords covered here will work across SQL implementations, we'll be using PostgreSQL's dialect for the examples in this section. If you wish to try these examples on a different SQL implementation, be prepared to make some adjustments to the syntax.
To follow along with this section, connect to an empty database on your PostgreSQL database server, either using the psql
command-line tool, the pgAdmin
graphical tool, or another database client software of your choosing.
Defining tables and inserting data
SQL tables are created...