SQL查詢初學者指南讀書筆記(一)關聯式資料庫和SQL介紹,初學者指南讀書筆記

來源:互聯網
上載者:User

SQL查詢初學者指南讀書筆記(一)關聯式資料庫和SQL介紹,初學者指南讀書筆記

PART I:Relational Databases and SQL


Chapter2, Ensuring Your Database Structure IsSound.

資料庫設計準則

 

什麼是關聯式資料庫

RDBMS (A Relational database management systems)關聯式資料庫

Tables

Tables are the mainstructures in the database. Each table always represents a

single, specificsubject.

 

Fields

A field is thesmallest structure in the database, and it represents a characteristic

of the subject ofthe table to which it belongs.

 

Records

A record representsa unique instance of the subject of a table.

 

Keys

Keysare special fields that play very specific roles within a table.eg.

  • primary key
  • foreign key

 

主鍵的最主要作用是保證資料記錄的唯一性,就是說主鍵約束要保證在一個資料庫表裡的所有的資料記錄都是不同的個體,例如:社會安全號碼碼可以保證一個人在大陸範圍內是一個獨立的個體(弄錯了的不算),即一個社會安全號碼碼不能標識兩個人或兩個社會安全號碼碼標識一個人。所以主鍵是從現有的資料裡分析出來的,不是設計人員隨意加上去的。

 

Relationships

  • one-to-one
  • one-to-many
  • many-to-many

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.