Back to Discovering SQL
Learn how to use SQL queries to get the same outcomes as an application.
We'll cover the following...
We'll cover the following...
Of course, it’s possible to implement the same expectations that we have seen in the previous lesson with a single SQL query without any application code being spent on solving the problem.
A single query vs. application code
The following query will do the same job as that done by the application code.
Press the “Run” button in the following widget to see the output of the code.
Code explanation
In this query, we use several basic SQL and PostgreSQL techniques that we might be discovering for the first time:
-
SQL accepts comments written either in
-- commentstyle, running from the opening to the end of the line, or C-style with a/* comment */...