Introduction to Writing SQL Queries
Learn about the placement of business logic with regards to databases.
We'll cover the following
Now, we’re going to learn how to write SQL queries. There are several ways to accomplish this, both from the SQL syntax and semantics points of view, which will be covered later. Here, we want to address how to write SQL queries as part of our application code.
Object-relational mapping (ORM)
Some developers prefer to use an
Also, to debug what happens in production, we need to be able to easily spot where the query comes from, replay it, edit it, and update our code with the new fixed version of the query.
Writing software
Before we go into detail about the specifics of those concerns, it might be a good idea to review how SQL actually helps us write software, what parts of the code we’re writing in the database layer, and how much we can or should be writing. The question is this: Is SQL a good place to implement business logic?
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy