組織埋一齊:不過,齋係記住啲數據係唔夠嘅,個數據庫跟住仲要將唔同嘅表嘅數據連繫埋一齊,簡單嘅例子有每位用家都俾個 ID 冧把佢,然後修改數據當中嘅每吓修改都有掕住做嗰吓修改嗰位用家嘅 ID 冧把,噉用個數據庫嘅人就有得攞住記用家數據嗰張表,叫部電腦去修改數據表嗰度,摷嗮嗰位用家做過嘅修改出嚟-啲數據之間有組織[8]。
上述講嘅例子可以用好似下圖噉嘅實體關係表畫出嚟[9]。下圖裏面每個視窗都表示一張專記住某種數據嘅表(例:user 係記用家數據嗰張表),個視窗入面每行字都係一個描述嗰種嘢嘅變數(例:user_id 係位用家嘅 ID 冧把、user_name 係嗰位用家嘅名、user_password 係嗰位用家嘅密碼... 等等)而且唔同表之間仲有某啲特定方法將唔同表嘅數據掕埋一齊。而除咗維基數據之外,疾病資料庫同互聯網電影資料庫都係喺廿一世紀初相當出名嘅數據庫。
喺廿一世紀初,數據庫入面嘅一幅試算表幾乎實會係以關係數據庫嘅形式表達嘅,即係話幅表會以表格嘅方式出現,有若干行打橫嘅列同埋若干行打戙嘅行,每列表示一個個案,每行表示一款數據。舉個簡單嘅例子說明,家陣整個數據庫,專門用嚟記住有關啲學生嘅數據,出好似下圖噉嘅表,每一行都表示一個學生可以有嘅一個特性,包括係名(Name)同主修嘅學科(Major)呀噉,而每一列都表示某一個學生嘅數據,包括嗰個學生嘅冧把,仲有係嗰個學生嘅 Name 同 Major 呀噉,做到清清楚楚噉表達嗮一柞個案同每個個案嘅特性[10]:
首先一個數據庫通常要有最少一行攞嚟做主匙(primary key);一條主匙係指個數據庫入面俾人揀嚟做到「每個個案都有自己獨有一個數值」嘅匙,例如好似上圖噉,上圖個數據庫記住咗啲學生嘅數據,不過 Name 同埋 Major 唔會做到主匙-呢個世上的確有可能會有學生真係咁啱得咁橋同名又讀同一個學科,好似响上圖入面學生 4 同學生 5 都係個名叫阿 John 而且一樣係讀化學嘅,因為噉,設計個數據庫嘅人就整咗一行叫 Number 表示學生號碼,同每個學生俾個獨一無二嘅號碼佢,嗰兩個讀化學嘅阿 John 號碼唔同,於是用個數據庫嘅人就有得靠住檢驗手上個學生嘅 Number,確保自己搵到嗰個學生真係自己想搵嗰個,而唔係一個咁啱同名同姓嘅人-Number 就係呢個數據庫條主匙[11]。主匙仲可以再細分做[12]
Cardoso, J. M., Assirati, L., & Setti, J. R. (2021). Calibration of the empirical fundamental relationship using very large databases. TRANSPORTES, 29(1), 212-228.
Tossell, C., Kortum, P., Shepard, C., Rahmati, A., & Zhong, L. (2015). Exploring smartphone addiction: insights from long-term telemetric behavioral measures. International Journal of Interactive Mobile Technologies, 9(2).
Bahmani, A. H., Naghibzadeh, M., & Bahmani, B. (2008, May). Automatic database normalization and primary key generation. In 2008 Canadian Conference on Electrical and Computer Engineering (pp. 000011-000016). IEEE.
Link, S., Luković, I., & Mogin, P. (2010). Performance evaluation of natural and surrogate key database architectures. School of Engineering and Computer Science, Victoria University of Wellington.
Sismanis, Y., Brown, P., Haas, P. J., & Reinwald, B. (2006, September). Gordian: efficient and scalable discovery of composite keys. In Proceedings of the 32nd international conference on Very large data bases (pp. 691-702).
Sumaray, A., & Makki, S. K. (2012, February). A comparison of data serialization formats for optimal efficiency on a mobile platform. In Proceedings of the 6th international conference on ubiquitous information management and communication (pp. 1-6).