2021-05-05 17:13:49 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5e9a093a74c4063ca6f7c163
|
2021-07-16 05:33:16 +00:00
|
|
|
|
title: 從數據庫中讀取數據
|
2021-05-05 17:13:49 +00:00
|
|
|
|
challengeType: 11
|
|
|
|
|
videoId: MtgXS1MofRw
|
|
|
|
|
dashedName: reading-data-from-databases
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
2021-07-16 05:33:16 +00:00
|
|
|
|
*在視頻中我們使用的編輯器工具是在 notebook.ai 這個平臺,你也可以選擇用其他的平臺,比如說 Google Colab 也是一個不錯的選擇。*
|
2021-05-05 17:13:49 +00:00
|
|
|
|
|
2021-07-16 05:33:16 +00:00
|
|
|
|
以下有更多的資料
|
2021-05-05 17:13:49 +00:00
|
|
|
|
|
2021-07-16 05:33:16 +00:00
|
|
|
|
- [在 GitHub 平臺的 Notebooks](https://github.com/ine-rmotr-curriculum/RDP-Reading-Data-with-Python-and-Pandas/tree/master/unit-1-reading-data-with-python-and-pandas/lesson-11-reading-data-from-relational-databases/files)
|
|
|
|
|
- [如何使用 Google Colab 來打開 GitHub 上的 Notebooks](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
2021-05-05 17:13:49 +00:00
|
|
|
|
|
|
|
|
|
# --question--
|
|
|
|
|
|
|
|
|
|
## --text--
|
|
|
|
|
|
2021-07-16 05:33:16 +00:00
|
|
|
|
`Cursor` 實例中都有什麼方法,這些方法能用來做什麼?
|
2021-05-05 17:13:49 +00:00
|
|
|
|
|
|
|
|
|
## --answers--
|
|
|
|
|
|
2021-07-16 05:33:16 +00:00
|
|
|
|
`Cursor` 實例中有方法 `.run()` ,它允許你運行 SQL 查詢語句。
|
2021-05-05 17:13:49 +00:00
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2021-07-16 05:33:16 +00:00
|
|
|
|
`Cursor` 實例中有方法 `.select()` ,它允許你選擇記錄。
|
2021-05-05 17:13:49 +00:00
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2021-07-16 05:33:16 +00:00
|
|
|
|
`Cursor` 實例有方法 `.execute()` , 它能夠接收在數據庫中運行的 SQL 參數。
|
2021-05-05 17:13:49 +00:00
|
|
|
|
|
|
|
|
|
## --video-solution--
|
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|