# PostgreSQL CRUD Basic Postgres 必備技能: - 撰寫高效率的查詢來獲取資料 - 設計資料表 - 了解進階功能 - 在正式環境中管理資料庫 第一個項目: https://en.wikipedia.org/wiki/List_of_largest_cities 設計一個資料庫儲存大型城市的資料 資料庫設計步驟: - 要儲存的東西是什麼:用於創建資料表 - 這個東西有什麼屬性:用於創建列(column) - 這些屬性包含什麼資料類型:用於規範列的資料類型 ![](https://i.imgur.com/Y3gQNWo.jpg) 使用小工具:https://pg-sql.com/ ## SQL 操作 ### 名詞解釋 Keyword(關鍵字): 告訴資料庫我們想要做什麼,大寫 Identifier(標示): 告訴資料庫我們想要對什麼事物進行操作,小寫 SQL is not just about pulling raw data out of a table -> we can write SQL to transform or pass data before we receive it (SQL can use Math Operator) ### Step of excuting a query :::info Understanding how query is interpreted is going to be a key to write complicate querys ::: You write query from left to right, but postgres excute in another way ![](https://i.imgur.com/e4SYpED.png) 1. get the entire source of data from the table (table) 2. apply filtering criteria (row) 3. get the field being selected (column) :::info SQL command order - do all mathematical calcuation - check conditional Discriminant ::: ###### tags: `DB` `postgresql` `Note`