• 添物零基础到大型全栈架构师 不花钱学计算机及编程(预备篇)— 数据库



    数据库是什么?

    数据库就是存放数据的仓库。

     

    为什么要学习数据库?

    为了开发的方便,大家基本使用统一数据库进行数据的存储盒检索。

     

    SQL是什么?

    SQL(Struct Query Language)是一标准,大家用来统一数据库操作使用的。比较简单和方便使用。

     

    数据库学习使用Windowds系统的可以用微软SQL Server进行实战,如果用Linux的话,就使用MySQL吧。Oracle和DB2就是高级点而已,一般互联网公司也不用,也就是电信和银行等巨头使用。

     

    参考视频学习网站:

    1.SQL教程 (杨中科)使用微软SQL Server讲解的。

    2.MySQL数据库(高洛峰)

    3.尚学堂马士兵Oracle视频教程

     

    参考图书:

    学哪种数据库可以选择其对应图书,也有些图书是通用的。有点经验再买也可以,一般官方文档就是最好的学习资料了。

    《Head First SQL》像看图画书一样学习SQL,Head系列都还可以。

    《Teach Yourself SQL in 21 Days》是非常不错的学习教程。

    《SQL必知必会(第3版)》也不错,一般多版的图书都不会差,好才会有需求。

     

    参考学习:

    SQL in 24 Hours

    强烈推荐此书:《Transact-SQL权威指南》

     

    SQL必知必会也可以

    如何衡量学习效果?

     

    Oracle是可以考证的,其他的我不知道。

    必须掌握和了解的基本概念(包括单不限于)

     

    DataBase/DB/表/行/列/视图/字段/字段类型/数据长度/SQL/存储过程/ACID/触发器/连接查询/左连接/右连接/内连接/外连接/管理系统/用户/用户权限/数据库系统管理员/备份/恢复/日志/查询分析等

     

    Edgar F. Codd  12 rules

     

    Rule 0: The Foundation rule:

    For any system that is advertised as, or claimed to be, a relational data base management system, that system must be able to manage data bases entirely through its relational capabilities.

     

    Rule 1: The information rule:

    All information in a relational data base is represented explicitly at the logical level and in exactly one way — by values in tables.

     

    Rule 2: The guaranteed access rule:

    Each and every data (atomic value) in a relational data base is guaranteed to be logically accessible by resorting to a combination of table name, primary key value and column name.

     

    Rule 3: Systematic treatment of null values:

    Null values (distinct from the empty character string or a string of blank characters and distinct from zero or any other number) are supported in fully relational DBMS for representing missing information and inapplicable information in a systematic way, independent of data type.

     

    Rule 4: Dynamic online catalog based on the relational model:

    The data base description is represented at the logical level in the same way as ordinary data, so that authorized users can apply the same relational language to its interrogation as they apply to the regular data.

     

    Rule 5: The comprehensive data sublanguage rule:

    A relational system may support several languages and various modes of terminal use (for example, the fill-in-the-blanks mode). However, there must be at least one language whose statements are expressible, per some well-defined syntax, as character strings and that is comprehensive in supporting 

    all of the following items:

    1.Data definition.

    2.View definition.

    3.Data manipulation (interactive and by program).

    4.Integrity constraints.

    5.Authorization.

    6.Transaction boundaries (begin, commit and rollback).

     

    Rule 6: The view updating rule:

    All views that are theoretically updatable are also updatable by the system.

     

    Rule 7: High-level insert, update, and delete:

    The capability of handling a base relation or a derived relation as a single operand applies not only to the retrieval of data but also to the insertion, update and deletion of data.

     

    Rule 8: Physical data independence:

    Application programs and terminal activities remain logically unimpaired whenever any changes are made in either storage representations or access methods.

     

    Rule 9: Logical data independence:

    Application programs and terminal activities remain logically unimpaired when information-preserving changes of any kind that theoretically permit unimpairment are made to the base tables.

     

    Rule 10: Integrity independence:

    Integrity constraints specific to a particular relational data base must be definable in the relational data sublanguage and storable in the catalog, not in the application programs.

     

    Rule 11: Distribution independence:

    A relational DBMS has distribution independence.

     

    Rule 12: The nonsubversion rule:

    If a relational system has a low-level (single-record-at-a-time) language, that low level cannot be used to subvert or bypass the integrity rules and constraints expressed in the higher level relational language (multiple-records-at-a-time).

     

    CAP理论(分布式系统)

    又称CAP定理,指的是在一个分布式系统中, Consistency(一致性)、 Availability(可用性)、Partition tolerance(分区容错性),三者不可得兼。

     

    分布式系统的CAP理论:理论首先把分布式系统中的三个特性进行了如下归纳:

     

       一致性(C):在分布式系统中的所有数据备份,在同一时刻是否同样的值。(等同于所有节点访问同一份最新的数据副本)

     

       可用性(A):在集群中一部分节点故障后,集群整体是否还能响应客户端的读写请求。(对数据更新具备高可用性)

     

       分区容错性(P):以实际效果而言,分区相当于对通信的时限要求。系统如果不能在时限内达成数据一致性,就意味着发生了分区的情况,必须就当前操作在C和A之间做出选择。

     

    再介绍几个高级内容

     

    数据仓库

    简单讲就是存放数据的仓库,形象点就是大的数据库。

     

    数据分析

    SQL基础必备。

     

    数据挖掘

    一般也有SQL的使用。

     

    NOSQL

    MongoDB

     

    Hadoop,Cassandra,HBase等


    总结

    实际工作中不完全按照书本上的模式走,完全可以不按范式规范。

     

    致敬:Edgar Frank Codd

     

    Codd提出了一个新的解决方案。在最终收集到1970年具有创新性的技术论文--A Relational Model of Data for Large Shared Data Banks(大型共享数据库的关系数据模型)中的一系列报告中,Codd建议将数据独立于硬件来存储,程序员使用一个非过程语言来访问数据。Codd的解决方案的关键,是将数据保存在由行和列组成的简单表中,而不是将数据保存在一个层次结构中。

     

    按照Codd的想法,数据库用户或应用程序不需要知道数据结构来查询该数据。发表了该论文之后不久,Codd又发布了更为详细的指导原则,提出了其指导创建关系数据库的12项原则。


    欢迎加入程序员的世界,添物科技为您服务。

    欢迎关注添物网的微信(微信号:tianwukeji),微博(weibo.com/91tianwu/),或下载添物APP,及时获取最新信息。
    免费加入QQ群:557373922(内有干货)。
    添物网(http://www.91tianwu.com)出品
    转载声明:本文系添物网原创出品,转载本文请标明出处,完整标注来源[添物网],(包括链接http://www.91tianwu.com)


  • 相关阅读:
    PAT Advanced 1044 Shopping in Mars (25) [⼆分查找]
    PAT Advanced 1029 Median (25) [two pointers]
    PAT Advanced 1010 Radix(25) [⼆分法]
    PAT Basic 1070 结绳(25) [排序,贪⼼]
    PAT Basic 1023 组个最⼩数 (20) [贪⼼算法]
    PAT Basic 1020 ⽉饼 (25) [贪⼼算法]
    PAT Advanced 1070 Mooncake (25) [贪⼼算法]
    PAT Advanced 1067 Sort with Swap(0,*) (25) [贪⼼算法]
    PAT Advanced 1038 Recover the Smallest Number (30) [贪⼼算法]
    PAT Advanced 1037 Magic Coupon (25) [贪⼼算法]
  • 原文地址:https://www.cnblogs.com/hehehaha/p/6332424.html
Copyright © 2020-2023  润新知