添物零基礎到大型全棧架構師 不花錢學計算機及編程(預備篇)— 數據庫


數據庫是什麼?程序員

數據庫就是存放數據的倉庫。數據庫

 

爲何要學習數據庫?express

爲了開發的方便,你們基本使用統一數據庫進行數據的存儲盒檢索。微信

 

SQL是什麼?數據結構

SQL(Struct Query Language)是一標準,你們用來統一數據庫操做使用的。比較簡單和方便使用。app

 

數據庫學習使用Windowds系統的能夠用微軟SQL Server進行實戰,若是用Linux的話,就使用MySQL吧。Oracle和DB2就是高級點而已,通常互聯網公司也不用,也就是電信和銀行等巨頭使用。分佈式

 

參考視頻學習網站:oop

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)