> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/18/tutorial.md).

# 第一部分：教學

歡迎閱讀 PostgreSQL 教學。本教學旨在介紹 PostgreSQL、關聯式資料庫的概念，以及 SQL 語言。我們假設你具備使用電腦的一般知識，但不需要特別的 Unix 或程式設計經驗。本教學的目的是讓你實際操作 PostgreSQL 系統的重要功能，並不打算完整涵蓋所介紹的各個主題。

順利完成本教學之後，你會想進一步閱讀[第二部分](https://docs.postgresql.tw/18/the-sql-language.md)，以更深入瞭解 SQL 語言；或閱讀[第四部分](https://docs.postgresql.tw/18/client-interfaces.md)，瞭解如何使用 PostgreSQL 開發應用程式。自行建置與管理 PostgreSQL 安裝環境的人，也應該閱讀[第三部分](https://docs.postgresql.tw/18/server-administration.md)。

**目錄**

* [1. 入門](https://docs.postgresql.tw/18/tutorial/tutorial-start.md)
  * [1.1. 安裝](https://docs.postgresql.tw/18/tutorial/tutorial-start/tutorial-install.md)
  * [1.2. 架構基礎](https://docs.postgresql.tw/18/tutorial/tutorial-start/tutorial-arch.md)
  * [1.3. 建立資料庫](https://docs.postgresql.tw/18/tutorial/tutorial-start/tutorial-createdb.md)
  * [1.4. 存取資料庫](https://docs.postgresql.tw/18/tutorial/tutorial-start/tutorial-accessdb.md)
* [2. SQL 語言](https://docs.postgresql.tw/18/tutorial/tutorial-sql.md)
  * [2.1. 簡介](https://docs.postgresql.tw/18/tutorial/tutorial-sql/tutorial-sql-intro.md)
  * [2.2. 概念](https://docs.postgresql.tw/18/tutorial/tutorial-sql/tutorial-concepts.md)
  * [2.3. 建立新資料表](https://docs.postgresql.tw/18/tutorial/tutorial-sql/tutorial-table.md)
  * [2.4. 將資料列加入資料表](https://docs.postgresql.tw/18/tutorial/tutorial-sql/tutorial-populate.md)
  * [2.5. 查詢資料表](https://docs.postgresql.tw/18/tutorial/tutorial-sql/tutorial-select.md)
  * [2.6. 資料表之間的聯結（JOIN）](https://docs.postgresql.tw/18/tutorial/tutorial-sql/tutorial-join.md)
  * [2.7. 彙總函式](https://docs.postgresql.tw/18/tutorial/tutorial-sql/tutorial-agg.md)
  * [2.8. 更新](https://docs.postgresql.tw/18/tutorial/tutorial-sql/tutorial-update.md)
  * [2.9. 刪除](https://docs.postgresql.tw/18/tutorial/tutorial-sql/tutorial-delete.md)
* [3. 進階功能](https://docs.postgresql.tw/18/tutorial/tutorial-advanced.md)
  * [3.1. 簡介](https://docs.postgresql.tw/18/tutorial/tutorial-advanced/tutorial-advanced-intro.md)
  * [3.2. 檢視表](https://docs.postgresql.tw/18/tutorial/tutorial-advanced/tutorial-views.md)
  * [3.3. 外部索引鍵](https://docs.postgresql.tw/18/tutorial/tutorial-advanced/tutorial-fk.md)
  * [3.4. 交易](https://docs.postgresql.tw/18/tutorial/tutorial-advanced/tutorial-transactions.md)
  * [3.5. Window 函式](https://docs.postgresql.tw/18/tutorial/tutorial-advanced/tutorial-window.md)
  * [3.6. 繼承](https://docs.postgresql.tw/18/tutorial/tutorial-advanced/tutorial-inheritance.md)
  * [3.7. 結語](https://docs.postgresql.tw/18/tutorial/tutorial-advanced/tutorial-conclusion.md)

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/tutorial.html)（原文版本：18.6；核對日期：2026-09-11）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/18/tutorial.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
