A code block is for when you have code; hence why it's called a code block. A quote block is for when you are quoting something; that might be an article, documentation, a quote/comment, book, or even an error. If that quote constrains code then the code inside the quote block should also be in a code block.
A very rudimentary example would be for a code block:
SELECT *
FROM dbo.YourTable;
As for a quote, you might use it in the following context:
The documentation gives the following example for the COALESCE
function:
A. Running a simple example
The following example shows how COALESCE
selects the data from the first column that has a nonnull value. This example uses the AdventureWorks2019 database.
SELECT Name, Class, Color, ProductNumber,
COALESCE(Class, Color, ProductNumber) AS FirstNotNull
FROM Production.Product;
Some things that aren't code may also, however, be better in a code block. For example if you posting part of a stack trace from an application that is erroring, these often are better put in a code block, due to the fact that they formatted better™, as they lend themselves to fixed-width fonts.
{}
)?