Professional Documents
Culture Documents
Communication
Technology
Luk Yin Shun
Chapter 8 Introduction to Database Design
8.1 The Basics of Database Design
Database Design:
produces the data model of a database
determines the structure, possible functionalities and efficiency of a system
Data model:
describe all the facts related to an information system
Database Design Condition Effects
Problems occur in data searching and
Unnecessarily duplicated data
updating
Inconsistent modifications Produce system bugs
If a parent record is deleted, all of its
Loss of critical data child records will be unable to refer
Poor Design back to this parent record
Child records may be refused to be
Introduction of null values
assigned as a primary key
Causing confusion and other
Inconsistent Identifiers problems in data enquiry and
application development of a system
No inconsistent Identifiers Easier to debug
No redundant data Higher utilization of storage space
The number of operations for data
The efficiency of the system is higher
modifications is minimized
Good Design
Data consistency is enforced The data reliability is higher
N.A. Avoid loss of data from deletion
The functionalities of the system can
N.A.
be extended flexibly
Table = Entity
Data Type = Domain
referential constraints (key) = Attributes
Index
B-Tree
Used with high distinct values(cardinality)
Index: a data structure to organize data in a specific way, so as to speed up the process of locating data
Root Node: Do not have a parent node
Leaf Node: Do not have a child node
Order of Tree: the maximum number of child nodes allowed for a node
Depth of Leaf Node: the number of levels between the root node and a leaf node
All elements in a node are sorted in ascending order form left to right
When searching for a record, the order is from the top to bottom and from left to right of the tree
R-tree index
Hash index: an index that makes use of the hash function to convert the data in a field into hash values
Generated has values are unique within the field
When a query is made to search for a particular value in that field, the database will convert the value into a
hash value using the sane hash function
This method of data searching is very fast as the hash value can be evaluated by the hash function instantly
without actually searching through all the field data.
Disadvantage:
If the indexed fields contain a lot of repeated values, the database will return many ROWIDs to the query.
The query will then need to check the ROWIDs on by one to locate the suitable record. Such a sequential
search will significantly slow down the searching process
Advantage: Dont have to completely search through the table