|
| 1 | +# AI Assistant & ER Diagram Generation |
| 2 | + |
| 3 | +Databricks AI Assistant helps with: |
| 4 | +1. Auto-generating SQL |
| 5 | +2. Documenting datasets |
| 6 | +3. Explaining columns and relationships |
| 7 | +4. Creating ER diagrams for schemas |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## 1. AI Assistant for SQL |
| 12 | + |
| 13 | +### Examples: |
| 14 | +``` |
| 15 | +Explain the structure of flights_silver_mv. |
| 16 | +``` |
| 17 | +``` |
| 18 | +Write a query showing top 10 busiest airports. |
| 19 | +``` |
| 20 | +``` |
| 21 | +Generate SQL for delays grouped by airline and month. |
| 22 | +``` |
| 23 | + |
| 24 | +Assistant outputs runnable SQL directly to the editor. |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## 2. Auto-Documentation with AI |
| 29 | + |
| 30 | +Open: |
| 31 | +``` |
| 32 | +Catalog Explorer → Table → AI Describe |
| 33 | +``` |
| 34 | + |
| 35 | +AI generates: |
| 36 | +- Summary of the table |
| 37 | +- Column definitions |
| 38 | +- Typical use cases |
| 39 | +- Suggested joins |
| 40 | +- Quality notes (if available) |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +## 3. Generate an ER Diagram |
| 45 | + |
| 46 | +Steps: |
| 47 | +1. Open **Catalog Explorer** |
| 48 | +2. Select: |
| 49 | + ``` |
| 50 | + dbsql_samuel.demo |
| 51 | + ``` |
| 52 | +3. Click **Relationships → View Diagram** |
| 53 | +4. The ER diagram shows: |
| 54 | + - Tables |
| 55 | + - MVs |
| 56 | + - Joins (inferred by matching column names) |
| 57 | + - Upstream/downstream lineage |
| 58 | + |
| 59 | +Export the diagram as **PNG** for your GitHub repo. |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## 4. Adding ER Diagram to GitHub |
| 64 | + |
| 65 | +Place exported file under: |
| 66 | +``` |
| 67 | +docs/er_diagram.png |
| 68 | +``` |
| 69 | + |
| 70 | +Add a short description in the README: |
| 71 | +- Bronze → Silver → Gold flow |
| 72 | +- Lookup relationships (UniqueCarrier ↔ UniqueCode) |
| 73 | +- Airport geography relationships |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## 5. Resume / GitHub Highlights |
| 78 | + |
| 79 | +You may state: |
| 80 | +- “Implemented AI-assisted SQL dataset documentation.” |
| 81 | +- “Generated ER diagrams with Unity Catalog lineage integration.” |
| 82 | +- “Developed analytics workflow using AI-assisted Databricks SQL.” |
| 83 | + |
0 commit comments