You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
![]() |
3 years ago | |
---|---|---|
.gitignore | 3 years ago | |
00_Hello, Postgres!.ipynb | 3 years ago | |
01_User Privileges.ipynb | 3 years ago | |
02_SQL Tutorial.ipynb | 3 years ago | |
03_Function_Procedure.ipynb | 3 years ago | |
LICENSE | 5 years ago | |
README.md | 3 years ago | |
_config.yml | 5 years ago | |
environment.yml | 3 years ago | |
postBuild | 3 years ago | |
requirements.txt | 3 years ago | |
start | 3 years ago |
README.md
Jupyter notebook for PostgreSQL
- 本專案使用 Jupyter Notebook 來提供 PostgreSQL 的教學文件,可以搭配指定的 PostgreSQL 主機,進行即時互動式的操作。
- 歡迎 PR 提供個人筆記。
線上操作
- Binder 是即時產生個人操作容器,啟動可能會稍久,請耐心等候。
- 操作過程都是暫存,不會永久保守唷。
- 無法指定資料庫版本。
準備
下載 PostgreSQL 並安裝。
安裝 Jupyter Notebook
- 下載 Anaconda 並安裝 (Windows推薦,亦有Linux版)。
- https://www.anaconda.com/download/
- Linux 亦可使用 jupyter-notebook 套件。
安裝 python 套件 - 打開 Anaconda Prompt (確定是安裝到 Anaconda 的環境中):
$ pip install ipython-sql psycopg2
- psycopg2 需要 PostgreSQL Server Development 套件,如 Ubuntu/Debian 中的 postgresql-server-dev-XX
- 如果你使用多個 python 環境,請特別注意是否是安裝到 Anaconda 的環境,或是你自有 Notebook 的 python 之中
使用
- 下載本專案,在本機解壓縮(或到Github只下載你有興趣的.ipynb檔)
- 在 Anaconda 中打開 Jupyter Notebook,切換目錄點選解壓後目錄中的檔案即完成。
- 筆記範例會真實執行 SQL 指令,請儘量選擇測試或臨時資料庫,以避免影響重要資料。
- 範例中的「%sql」及「%%sql」為 ipython 的指令,複製 SQL 語法到其他環境時,請避免包含它們。
Jupyter Notebook Viewer
你也可以使用 Jupter Notebook Viewer 觀看。
參閱
- ipython-sql: Notebook 裡的 SQL 延伸套件詳細使用方式
- MADlib library: MADlib 提供的 Notebook 範例集合
版權
本筆記由 PostgreSQL 台灣使用者社群提供,採 CC BY 4.0 授權。