🎯 SQL Practice

Artifacts & Code

Claude doesn't just write code — it generates real files you can download and run.

What are Artifacts?

Artifacts are Claude's way of generating real files rather than just code blocks in chat. When you ask Claude to write a script, build a webpage, or create a document, it can render an Artifact — a file that appears in a preview panel on the right side of the screen, and that you can copy, download, or iterate on.

Types of Artifacts

Artifact typeExtensionWhat it does
Python script.pyRunnable Python code
HTML page.htmlRendered live preview in the panel
React component.jsxInteractive UI, rendered live
Markdown document.mdFormatted document preview
SQL file.sqlQuery or schema file
Mermaid diagram.mermaidFlowcharts, ER diagrams rendered live
CSV / JSON.csv / .jsonStructured data files

Triggering Artifacts

Claude automatically creates an Artifact when you ask for something that's clearly a standalone file. You can also explicitly request one:

Iterating on Artifacts

Once an Artifact exists, you can modify it by asking Claude to make changes:

Claude updates the Artifact in-place. You can see the full version history by clicking the version indicator in the Artifact panel.

React Artifacts for data engineers

React Artifacts are particularly powerful — Claude can build interactive dashboards, data grids, and calculators that run live in the browser:

EXAMPLE PROMPT FOR REACT ARTIFACT "Build a React component that takes a SQL query result as JSON input and renders an interactive table with column sorting and a search filter. Use Tailwind for styling."

Claude will produce a complete React component using Tailwind, recharts, and shadcn/ui components — rendered and interactive immediately in the Artifact panel.

Downloading and using Artifacts

Every Artifact has a Copy and Download button in the top right of the panel. Download gives you the actual file — .py, .html, .sql, .md, etc. You can then open it directly in VS Code, run it in terminal, or deploy it.

WORKFLOW: BUILD A TOOL WITH CLAUDE 1. Describe what the tool should do (be specific about inputs/outputs)
2. Claude generates a React or HTML Artifact
3. Iterate: "add X feature", "fix Y bug", "make Z cleaner"
4. Download the final file
5. Deploy to GitHub Pages, Vercel, or embed in your site

This entire website was built using this exact workflow with Claude.