Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Terms t DBMS –Database Management System. A software used to organise, analyse, store, retrieve, and edit information. –e.g., Visual FoxPro, Access.

Similar presentations


Presentation on theme: "Database Terms t DBMS –Database Management System. A software used to organise, analyse, store, retrieve, and edit information. –e.g., Visual FoxPro, Access."— Presentation transcript:

1 Database Terms t DBMS –Database Management System. A software used to organise, analyse, store, retrieve, and edit information. –e.g., Visual FoxPro, Access

2 Database Terms t Database –collection of data organised for storage in a computer memory. In relational database, information are stored in the form of table.

3 Database Terms t Record –a unit of storage in a database. In relational database, the rows of table represent records.

4 Database Terms t Field –a data unit in a record. In relational database, the columns of table represent fields. Since fields have different characteristics (numeric, character, date, etc.), they are also called “attributes”.

5 Database Terms t Key –a KEY is used to uniquely identify a record in the database. –a KEY can be a single field or combination of fields

6 Database namestud_iddob WinnieF00111{02/14/83} AmyF00112{03/16/82} SteveF00007{10/28/83} AmyF00246{08/25/82} Field Record Key

7 Database Design t Aims –to keep data integrity (correctness and completeness) with the least for space data duplication updating efforts

8 Database Design t Basic design –there must exist a KEY that uniquely determines the entire record –e.g., student identity that uniquely determines a student record

9 Sample Address Book Name: Tele: Address:

10 Sample Address Book Name Tele Field name Char. Data type 15 8 Width ADDRBOOK.DBF AddressChar.40

11 Sample Student Report Student ID: f99007Student Name: Wong Siu Fu Average Mark: 60.25 Subject Code Subject Description. Marks C01 E01 Chinese English 62.00 64.00 M01Mathematics...... 86.00............ Class: 6F

12 Sample Student Report stud_id name sub_code sub_desc marks ave_mk Field name Char. Numeric Data type 6 25 3 15 3 6 (2 d.p.) Width SREPORT.DBF classChar.2

13 Sample Student Report SREPORT(stud_id, name, class, sub_code, sub_desc, marks, ave_mk)

14 Sample Student Report Student ID: f99008Student Name: Po King Wan Average Mark: 60.25 Subject Code Subject Description. Marks C01 E01 Chinese English 60.00 66.00 M01Mathematics...... 72.00............ Class: 6F

15 Database Terms t Data Redundancy ( 冗餘數據 ) –same data item exists in one or more databases. –Disadvantage: duplication causes wasted storage space efforts to maintain common data up-to-date

16 Database Terms t Data Integrity ( 數據完整性 ) –refers to the correctness and completeness of information in the database.

17 Data Normalisation t a step-by-step process that is used to decompose a database into two or more databases t in order to avoid side effects during the operation of a database involving insertion, deletion and updating records.

18 Data Normalisation t First Normal Form (1NF) t Second Normal Form (2NF) t Third Normal Form (3NF)

19 Data Normalisation t First Normal Form (1NF) –if every attribute is based upon a simple, unique value, i.e., there are no repeating groups of attribute types.

20 Sample Student Report SREPORT(stud_id, name, class, (sub_code, sub_desc, marks), ave_mk)

21 Data Normalisation Deriving 1NF SREPORT(stud_id, name, class, ave_mk) MARKS(stud_id, sub_code, sub_desc, marks)

22 Data Normalisation t Second Normal Form (2NF) –it is already in 1NF and if each non-key attribute depends fully upon the key.

23 Data Normalisation SREPORT(stud_id, name, class, ave_mk) MARKS(stud_id, sub_code, sub_desc, marks)

24 Data Normalisation Deriving 2NF SREPORT(stud_id, name, class, ave_mk) MARKS(stud_id, sub_code, marks) SUBJECT(sub_code, sub_desc)

25 Data Normalisation t Third Normal Form (3NF) –it is already in 2NF and if there is no dependency between non-key attribute.

26 Data Normalisation Deriving 3NF SREPORT(stud_id, name, class, ave_mk) MARKS(stud_id, sub_code, marks) SUBJECT(sub_code, sub_desc)

27 Sample Invoice INVOICE NUMBER: 100486-300 Customer Number: C12345 Customer Address: Hang Shin Link Invoice Date: 04/01/99 Item CodeItem Desc.Item PriceQuantityPrice Total: 1123 1246 Chocolate Coke 8.00 5.00 2 1260.00 16.00 76.00

28 Data Normalisation Invoice(Inv_no, Cust_no, Cust_Addr, Inv_date, (Item_code, Item_desc, Item_price, Qty, Price), Total)

29 Data Normalisation Deriving 1NF Invoice(Inv_no, Cust_no, Cust_Addr, Inv_date, Total) ItemDetails(Inv_no, Item_code, Item_desc, Item_price, Qty, Price)

30 Data Normalisation Deriving 2NF Invoice(Inv_no, Cust_no, Cust_Addr, Inv_date, Total) ItemDetails(Inv_no, Item_code, Qty, Price) Items(Item_code, Item_desc, Item_price)

31 Data Normalisation Deriving 3NF Invoice(Inv_no, Cust_no, Inv_date, Total) Customer(Cust_no, Cust_Addr) ItemDetails(Inv_no, Item_code, Qty, Price) Items(Item_code, Item_desc, Item_price)

32 Partial Dependence ItemDetails(Inv_no, Item_code, Item_desc, Item_price, Qty, Price) The non-key fields “Item_desc” and “Item_price” is dependent partly on the key, i.e., “Item_code”. This is known as partial dependence.

33 Transitive Dependence Invoice(Inv_no, Cust_no, Cust_Addr, Inv_date, Total) The non-key field “Cust_Addr” is dependent on the non-key field “Cust_no”, this is known as transitive dependence.

34 Database Terms t Data Independence –refers to the data in a database which is separated from the application programs that manipulate it.


Download ppt "Database Terms t DBMS –Database Management System. A software used to organise, analyse, store, retrieve, and edit information. –e.g., Visual FoxPro, Access."

Similar presentations


Ads by Google