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, specific subject.

 

Fields

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

of the subject of the table to which it belongs.

 

Records

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

 

Keys

Keys are special fields that play very specific roles with in a table.eg.

  • primary key
  • foreign key

 

主键的最主要作用是保证数据记录的唯一性,就是说主键约束要保证在一个数据库表里的所有的数据记录都是不同的个体,例如:身份证号码可以保证一个人在大陆范围内是一个独立的个体(弄错了的不算),即一个身份证号码不能标识两个人或两个身份证号码标识一个人。所以主键是从现有的数据里分析出来的,不是设计人员随意加上去的。

 

Relationships

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值