-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.sqlnb
More file actions
20 lines (20 loc) · 1.05 KB
/
sample.sqlnb
File metadata and controls
20 lines (20 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"cells": [
{
"type": "markdown",
"content": "# My First SQL Notebook\n\n## Getting Started\n1. Press `Cmd+Shift+P` (Mac) or `Ctrl+Shift+P` (Windows/Linux) and run **SQL Notebook: Connect to Database**\n2. Paste your connection string (e.g. `postgresql://postgres:password@localhost:5432/mydb`)\n3. Click the ▶ play button on any SQL cell below to execute it\n\n---"
},
{
"type": "sql",
"content": "-- List all tables in your database\nSELECT \n table_schema,\n table_name\nFROM information_schema.tables \nWHERE table_schema NOT IN ('pg_catalog', 'information_schema')\nORDER BY table_schema, table_name;"
},
{
"type": "markdown",
"content": "## Tips\n- Use `Cmd+Shift+P` → **SQL Notebook: Show Schema** to inspect all columns & data types\n- Use `Cmd+Shift+P` → **SQL Notebook: Export Last Result to CSV** to save your data\n- Adjust `sqlNotebook.maxRows` in VS Code settings to control how many rows are displayed"
},
{
"type": "sql",
"content": "SELECT 1 as hello_world;"
}
]
}