Comments in SQL

Let's look at the available options in terms of SQL comments in BigQuery.
If you ever need to pass on a note to the future you or a fellow developers about the reasoning behind a particular approach or something to watch out for in a query, you can write a comment.
Based on where we put them, we can distinguish between:
- single line, taking the entire line
- in-line, comments intertwined with code
- multi-line, comments spanning across lines
With regards to the notation, we have:
- the '--' will turn everything after it on the same line into a comment
- the '#' which you might recognize from say Python, and works like '--'
- the '/* */' block which clearly marks it start and end, making possible the insertions of a comment inside a code line and multi-line comments
How much are you using comments in your SQL code and in what situations?
WITH orderline_updates AS (
SELECT 1 AS order_id, 'Apples' AS product, 10 AS quantity, '2021-01-01 12:00:12' AS last_updated UNION ALL
SELECT 1 AS order_id, 'Grapes' AS product, 3 AS quantity, '2021-01-01 12:00:12' AS last_updated UNION ALL
SELECT 2 AS order_id, 'Mangoes' AS product, 1 AS quantity, '2021-01-02 10:00:19' AS last_updated UNION ALL
SELECT 2 AS order_id, 'Kiwi' AS product, 6 AS quantity, '2021-01-03 12:24:33' AS last_updated
)
-- single line comment, taking the entire line
SELECT
order_id, -- inline comment
product, # also an inline comment
quantity /* also an inline comment, but you can write code after it */ AS total_quantity,
last_updated
/*
comment spanning multiple lines:
a multi-line comment
*/
FROM orderline_updates
