Professional Documents
Culture Documents
Data versus Information 數據及信息的分別: Lions College F.7 Computer Application Teaching Notes 2002-2003
Data versus Information 數據及信息的分別: Lions College F.7 Computer Application Teaching Notes 2002-2003
User stores data in the database only require to store in one location. Storing the same
field values more than once (unnecessarily) is referred to as data redundancy.
每用戶儲存自己數據在數據庫,祇需在一個位置貯存,便可供不同用戶使用。儲
存用樣數據多於一次便屬多餘數據(冗餘)。
53051131.doc 1
Lions College F.7 Computer Application Teaching Notes 2002-2003
Topic 4 Databases 數據庫 4.1 Concept and Terminology 概念及術語
Data versus Information 數據及信息的分別
data characteristics: independence, redundancy, integrity 數據特性:獨立性,冗餘,完整性
Database terminology: Database, file, record, field, base table, table, column, row
數據庫術語:數據庫,檔案,記錄,欄,庫登記表,表,欄,列
冗餘數據有三個缺點:
1. 增加儲存時間及浪費儲存位置。
2. 如修改數據,不同檔案的數據要隨之更新。
3. 如忘記修改檔案內的數據,數據庫的數據便不協調。
Database 數據庫
A database is a large repository of data. It can collect, index, store and display data
systematically. It can also combine related data together. Normally database is
controlled by a software package Database Management System (DBMS).
Information is retrieved, edited and stored using commands.
數據庫是一個儲存大量數據的儲存庫,能有系統地收集、分類、貯存和顯示數據
並能把相關的數據整理合併一起。通常是由數據庫管理系統控制(DBMS).
When data is stored in a computer, it is stored in files. Before any data is stored in a
database, a structure must be defined for the data file. For example, a student
information data file will consist the student name, class, class number, address,
telephone, parent names etc. Different records represent different students similar to a
table. Therefore, the data files in a database are also called base tables (tables).
數據儲存於電腦是以檔案型式儲存,數據儲存時,必須先設定數據檔案的結構。
例如一個學生的資料數據檔案會包括學生的姓名,班級,班號,地址,電話,
家長姓名等資料。不同的記錄代表不同學生如表格型式表示,所以數據檔案亦稱
為庫登記表(表)。
53051131.doc 2
Lions College F.7 Computer Application Teaching Notes 2002-2003
Topic 4 Databases 數據庫 4.1 Concept and Terminology 概念及術語
Data versus Information 數據及信息的分別
data characteristics: independence, redundancy, integrity 數據特性:獨立性,冗餘,完整性
Database terminology: Database, file, record, field, base table, table, column, row
數據庫術語:數據庫,檔案,記錄,欄,庫登記表,表,欄,列
There are five teachers in Lions College. They are stored in the file teacher.dbf as
follows:
假設獅子會有5個教師,儲存於 teacher.dbf 檔案的資料如下:
Teacher Table
Rec# Class Name Address Phone
Record 1 1A Mr. Chan 20 Abc Street 1234567
Record 2 1B Miss Lee 130 Sai Yi Street 2345678
Record 3 1C Miss Wong 226 Prince Road 3456789
Record 4 1D Miss Lau 783 Hing Shing Road 4567891
Record 5 2A Mr. Chan 1 Nathan Road 5678912
The above data appear in the form of a table with 5 rows and 4 columns. Thus a
data file is also called a table. Each row corresponds to one record. Each column
corresponds to the data in the same field. A record represents one teacher data. In
each record, there are four fields, representing four pieces of information of a teacher.
上述的資料是用5列4欄的表形式排列,故數據檔案亦可稱為表。每列為一記錄
每欄儲存同一欄位數據。一個記錄代表一個教師的記錄。在每一記錄中,會有4
欄,代表一教師的資料。
Visual FoxPro uses fixed length records. In designing the structure of a table, we
need to specify the data type and the length of each field. The structure for the
teacher.dbf table is depicted as follows:
Visual FoxPro 用一個固定長度的記錄,在設計表的結構,要先決定數據的種類
及記錄的長度,教師的數據表是用下列的結構:
53051131.doc 3
Lions College F.7 Computer Application Teaching Notes 2002-2003
Topic 4 Databases 數據庫 4.1 Concept and Terminology 概念及術語
Data versus Information 數據及信息的分別
data characteristics: independence, redundancy, integrity 數據特性:獨立性,冗餘,完整性
Database terminology: Database, file, record, field, base table, table, column, row
數據庫術語:數據庫,檔案,記錄,欄,庫登記表,表,欄,列
The records in the data file teacher.dbf can be accessed through the field CLASS,
NAME, ADDRESS, or PHONE. However, the field NAME not a good candidate for
accessing records, since Mr. Chan appears in both Record 1 and Record 5. The field
NAME has duplicated values or not unique
在 教 師 teacher.dbf 數 據 檔 案 的 數 據 可 以 用 欄 CLASS, NAME, ADDRESS, 或
PHONE。但欄位 NAME 不是一個選取記錄的好欄位,因為 Mr. Chan 在記錄1及
5均有出現,NAME 欄位有重覆的數據或者可以說不是單一記錄。
Exercise
1. Explain why a database file is often called a table ?
解釋數據檔案又叫表的原因?
2. What is data independence, data redundancy, data integrity ?
甚麼是數據獨立性,冗餘數據,完整數據?
3. What is the difference between a database and a database table ?
數據庫和表的分別是甚麼?
4. What are the three problems caused by data redundancy ?
冗餘數據產生的3個問題是甚麼?
5. Explain row and column in a database table ?
在數據庫中,列和欄的分別是甚麼?
6. Why do we need Database Management System (DBMS)?
為甚麼我們需要數據庫管理系統?
53051131.doc 4