![](/static/66c60d9f/assets/icons/icon-96x96.png)
![](https://programming.dev/pictrs/image/8140dda6-9512-4297-ac17-d303638c90a6.png)
4·
1 year agoHe is either over-worked and doesn’t have time to abide by team standards, or lazy. If lazy, reject the PR for failing to meet standards.
He is either over-worked and doesn’t have time to abide by team standards, or lazy. If lazy, reject the PR for failing to meet standards.
Your friend may have a point.
It depends where the SQL is.
Is the SQL in a data model in an analytics platform? Some platforms will happily carry comments around like last week’s pizza during query generative phases of visualization, so it may not be appropriate to put comments inside a data model, as those comments could become bugs if the analytics platform is lame, like most are.
Others, certain flavors of SQL DDL (Tables, views, etc), comments outside the DDL don’t make it inside the resulting object, so headers may not be the right place either. Most RDBMS have meta-descriptors that can apply to DDL so those might be good to look at.
For arbitrary SQL, outside a brief inline comment describing why it exists, and what invokes it, your next best bet may be a link to a more descriptive data architecture diagram that shows how this unit of SQL integrates with others. You might prefer hyperlinked descriptions from that data architecture over searching thru code.
As long as comments don’t require continual parsing (a one-time tax is inconsequential), definitely add details that you have figured out so others don’t have to re-learn the tribal mysteries of long-deceased ancients.