欢迎投稿

今日深度:

SQL查询初学者指南读书笔记(一)关系数据库和SQ

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

www.htsjk.Com true http://www.htsjk.com/shujukunews/8498.html NewsArticle SQL查询初学者指南读书笔记(一)关系数据库和SQL介绍,初学者指南读书笔记 PART I:Relational Databases and SQL Chapter2, Ensuring Your Database Structure Is Sound. 数据库设计准则 什么是关系数据库 RDBMS...
评论暂时关闭