<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to manage SQL queries for business data extraction in Databricks? in Warehousing &amp; Analytics</title>
    <link>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165325#M2672</link>
    <description>&lt;P&gt;&lt;FONT size="3"&gt;Hi Hill22,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;You can manage ad-hoc business data extraction requests inside Databricks without taking on heavy DevOps overhead at this stage. Keep the SQL queries inside Databricks SQL until an extraction actually requires to be elevated into a managed production asset.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;You can follow below&lt;/FONT&gt;&lt;/DIV&gt;&lt;H3&gt;&lt;FONT size="3"&gt;Storage and Workspace Structure&lt;/FONT&gt;&lt;/H3&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;You can save the SQL queries directly as Databricks SQL Queries rather than notebooks or Git repositories. For pure ad-hoc extractions, Git integration may create unnecessary friction for analysts who need to pull a quick answer for business stakeholders.&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="3"&gt;Organize them under /Workspace/Shared/Data Requests/&amp;nbsp;by department (/Shared/Data Requests/Finance/). Keep a dedicated /Archive/ subfolder within each domain directory so completed or old queries can be moved out of the primary workspace view.&lt;/FONT&gt;&lt;/DIV&gt;&lt;H3&gt;&lt;FONT size="3"&gt;Naming Pattern&lt;/FONT&gt;&lt;/H3&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;You can adopt a strict, sortable naming format so anyone browsing the folder instantly understands the context without having to open the query file.&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;[Task]_[ShortDescription]&lt;/FONT&gt;&lt;/DIV&gt;&lt;H3&gt;&lt;FONT size="3"&gt;Metadata Header&lt;/FONT&gt;&lt;/H3&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;You can use a standard SQL comment block at the very top of every saved query rather than maintaining a separate tracking sheet or registry table that will inevitably drift out of date&lt;/FONT&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Requester: Name / Email&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Purpose: Problem this query answers&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Ticket Ref: JIRA / ServiceNow ticket link or ID&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Owner: Analyst who built the query&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Status: Active, Recurring or Archived&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;&lt;FONT size="3"&gt;Auditing and Lifecycle Tracking via System Tables&lt;/FONT&gt;&lt;/H3&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Instead of manually tracking usage leverage Unity Catalog audit execution history across the workspace to drive lifecycle decisions.&lt;/FONT&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Dormant queries - Saved queries that haven't been run in 90+ days, making them candidates to be moved into the /Archive/ folder.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Keep queries in domain-structured folders with structured comment headers as it handles the vast majority of extraction requests without building complexity.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 11 Aug 2026 09:35:23 GMT</pubDate>
    <dc:creator>balajij8</dc:creator>
    <dc:date>2026-08-11T09:35:23Z</dc:date>
    <item>
      <title>How to manage SQL queries for business data extraction in Databricks?</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165321#M2671</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P class=""&gt;Our data team frequently receives data extraction requests from business teams. Most requests are relatively simple and are handled by writing SQL queries in Databricks.&lt;/P&gt;&lt;P class=""&gt;We are looking for a good way to manage these SQL queries as the number of requests grows.&lt;/P&gt;&lt;P class=""&gt;For example:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Where should these SQL queries be stored?&lt;/LI&gt;&lt;LI&gt;Should they be managed in Git, Databricks SQL, or another tool?&lt;/LI&gt;&lt;LI&gt;How do you organize and name queries?&lt;/LI&gt;&lt;LI&gt;How do you track the requester, purpose, owner, and status of each query?&lt;/LI&gt;&lt;LI&gt;How do you handle old or unused queries?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;We don't necessarily want to turn every request into a view, table, or dashboard. The main goal is to establish a simple and maintainable process for managing business data extraction SQL.&lt;/P&gt;&lt;P&gt;What is the recommended approach or best practice for this in Databricks?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2026 09:13:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165321#M2671</guid>
      <dc:creator>HILL22</dc:creator>
      <dc:date>2026-08-11T09:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to manage SQL queries for business data extraction in Databricks?</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165325#M2672</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;Hi Hill22,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;You can manage ad-hoc business data extraction requests inside Databricks without taking on heavy DevOps overhead at this stage. Keep the SQL queries inside Databricks SQL until an extraction actually requires to be elevated into a managed production asset.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;You can follow below&lt;/FONT&gt;&lt;/DIV&gt;&lt;H3&gt;&lt;FONT size="3"&gt;Storage and Workspace Structure&lt;/FONT&gt;&lt;/H3&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;You can save the SQL queries directly as Databricks SQL Queries rather than notebooks or Git repositories. For pure ad-hoc extractions, Git integration may create unnecessary friction for analysts who need to pull a quick answer for business stakeholders.&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="3"&gt;Organize them under /Workspace/Shared/Data Requests/&amp;nbsp;by department (/Shared/Data Requests/Finance/). Keep a dedicated /Archive/ subfolder within each domain directory so completed or old queries can be moved out of the primary workspace view.&lt;/FONT&gt;&lt;/DIV&gt;&lt;H3&gt;&lt;FONT size="3"&gt;Naming Pattern&lt;/FONT&gt;&lt;/H3&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;You can adopt a strict, sortable naming format so anyone browsing the folder instantly understands the context without having to open the query file.&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;[Task]_[ShortDescription]&lt;/FONT&gt;&lt;/DIV&gt;&lt;H3&gt;&lt;FONT size="3"&gt;Metadata Header&lt;/FONT&gt;&lt;/H3&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;You can use a standard SQL comment block at the very top of every saved query rather than maintaining a separate tracking sheet or registry table that will inevitably drift out of date&lt;/FONT&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Requester: Name / Email&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Purpose: Problem this query answers&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Ticket Ref: JIRA / ServiceNow ticket link or ID&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Owner: Analyst who built the query&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Status: Active, Recurring or Archived&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;&lt;FONT size="3"&gt;Auditing and Lifecycle Tracking via System Tables&lt;/FONT&gt;&lt;/H3&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Instead of manually tracking usage leverage Unity Catalog audit execution history across the workspace to drive lifecycle decisions.&lt;/FONT&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Dormant queries - Saved queries that haven't been run in 90+ days, making them candidates to be moved into the /Archive/ folder.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;DIV&gt;&lt;FONT size="3"&gt;Keep queries in domain-structured folders with structured comment headers as it handles the vast majority of extraction requests without building complexity.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 11 Aug 2026 09:35:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165325#M2672</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-08-11T09:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to manage SQL queries for business data extraction in Databricks?</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165335#M2673</link>
      <description>&lt;P&gt;Thanks, this is very helpful. I think the lightweight approach using Databricks SQL Queries, domain-based folders, metadata headers, and an archive process makes a lot of sense for our current situation.&lt;/P&gt;&lt;P&gt;Our main concern is that the number of queries may grow significantly over time, so simply organizing them into folders might eventually become difficult to navigate.&lt;/P&gt;&lt;P&gt;Would you recommend maintaining a lightweight index/catalog in addition to the folder structure, or do you think a good naming convention, folder structure, and metadata for each query are sufficient for managing a large number of queries?&lt;/P&gt;&lt;P&gt;Also, for the 90-day rule, would you treat it as a review trigger rather than automatically archiving the query?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2026 10:05:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165335#M2673</guid>
      <dc:creator>HILL22</dc:creator>
      <dc:date>2026-08-11T10:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to manage SQL queries for business data extraction in Databricks?</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165339#M2674</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/241128"&gt;@HILL22&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;For a simple and maintainable process, the best approach is to use the native &lt;STRONG&gt;Databricks SQL (DBSQL) Queries&lt;/STRONG&gt; feature combined with &lt;STRONG&gt;Tags&lt;/STRONG&gt; and &lt;STRONG&gt;Workspace Folders&lt;/STRONG&gt;.&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ShamenParis_1-1786443027792.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/29880i8CB03F4963F282B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ShamenParis_1-1786443027792.png" alt="ShamenParis_1-1786443027792.png" /&gt;&lt;/span&gt;&lt;P&gt;Here is how you can set up that workflow:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. &lt;/STRONG&gt;Save them directly in the &lt;STRONG&gt;Databricks SQL &amp;gt; Queries&lt;/STRONG&gt; section. Create a dedicated folder structure in your Workspace (e.g., Shared/Ad-hoc_Requests/Finance or Shared/Ad-hoc_Requests/Marketing) to keep them out of personal user folders.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2. &lt;/STRONG&gt;Use the native &lt;STRONG&gt;Tags&lt;/STRONG&gt; feature on the query in the DBSQL UI. You can create a standardized tagging system like:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Department:&lt;/STRONG&gt; finance, sales&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Requester:&lt;/STRONG&gt; req:john_doe&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Status:&lt;/STRONG&gt; active, one-off, deprecated&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;I&gt;Pro-tip:&lt;/I&gt; Put a standard comment block at the very top of the SQL code for the details:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;SQL&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;/*
Requester: John Doe (Marketing)
Ticket: JIRA-1234
Purpose: Extract Q3 churned users for email campaign
Owner: Data Team
*/&lt;/SPAN&gt;
&lt;SPAN class=""&gt;SELECT&lt;/SPAN&gt; ...&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;3. &lt;/STRONG&gt;Because you are using tags, you can easily filter the Queries UI by the one-off or deprecated tags and delete them quarterly. You can also look at the &lt;STRONG&gt;"Last Run"&lt;/STRONG&gt; column in the Queries list to quickly spot queries that haven't been touched in months.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4. &lt;/STRONG&gt;If your team wants version control later, you can save these as .sql files inside &lt;STRONG&gt;Databricks Git Folders (Repos)&lt;/STRONG&gt;. However, if your main goal is &lt;I&gt;simplicity&lt;/I&gt; right now, just stick to the DBSQL Queries UI with strict tagging and folder management.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2026 10:10:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165339#M2674</guid>
      <dc:creator>ShamenParis</dc:creator>
      <dc:date>2026-08-11T10:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to manage SQL queries for business data extraction in Databricks?</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165341#M2675</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;The catalog table generally adds&amp;nbsp;maintenance overhead in manual cases as it&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;can drift out of sync with actual queries if managed manually.&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3"&gt;Databricks capabilities might be enough as you can use&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;Workspace search&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN&gt;searches across query names and content including SQL comments),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Folder browsing&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;works fine up to 100-200 queries per folder,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;System tables&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;automatically tracks who ran what and when and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SQL comments&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;contain all the metadata you need&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;You can start simple and add complexity only if needed.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;FONT size="3"&gt;Start with:&amp;nbsp;Folders + naming convention + SQL comment metadata&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="3"&gt;Use workspace search&amp;nbsp;when you need to find something&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="3"&gt;Query system tables&amp;nbsp;periodically to identify unused queries &amp;amp; usage statistics&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="3"&gt;Add a catalog table or an app that takes the request info &amp;amp; load the catalog table or you can run it via workflow when&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="3"&gt;Workspace search isn't sufficient &amp;amp; you get&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="3"&gt;complex reporting requests&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;FONT size="3"&gt;You can skip additional table unless you're managing&amp;nbsp;thousands&amp;nbsp;of queries or need sophisticated reporting/analytics on the requests as the lightweight approach (folders + naming + comments) is usually sufficient for direct cases.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;90-day rule is a trigger to highlight unused queries. You can archive it using workflows after a review.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2026 10:25:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165341#M2675</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-08-11T10:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to manage SQL queries for business data extraction in Databricks?</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165353#M2677</link>
      <description>&lt;P&gt;Thanks for the detailed suggestions! This is very helpful. I think the lightweight approach with domain-based folders, naming conventions, metadata, and an archive process fits our use case very well. I really like the idea of keeping the management simple within Databricks without introducing unnecessary overhead.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2026 12:03:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165353#M2677</guid>
      <dc:creator>HILL22</dc:creator>
      <dc:date>2026-08-11T12:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to manage SQL queries for business data extraction in Databricks?</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165355#M2678</link>
      <description>&lt;P&gt;Thanks for the great suggestions! I hadn't considered using Query Tags in this way. Combining tags with folders and naming conventions seems like a practical approach for keeping the queries organized as they grow. Really appreciate the helpful advice!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2026 12:04:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/how-to-manage-sql-queries-for-business-data-extraction-in/m-p/165355#M2678</guid>
      <dc:creator>HILL22</dc:creator>
      <dc:date>2026-08-11T12:04:10Z</dc:date>
    </item>
  </channel>
</rss>

