importance of database design (1)

19
DATABASE DESIGN

Upload: yhen06

Post on 05-Feb-2015

5.247 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Importance of database design (1)

DATABASE DESIGN

Page 2: Importance of database design (1)

Database design is the process of producing a detailed data model of a database.

Page 3: Importance of database design (1)

This logical data model contains all the needed logical and physical design choices and physical storage parameters needed to generate a design in a Data Definition Language, which can then be used to create a database.

Page 4: Importance of database design (1)

 A fully attributed data model contains detailed attributes for each entity.

Page 5: Importance of database design (1)

Usually, the designer must:

Determine the relationships between the different data elements.

Superimpose a logical structure upon the data on the basis of these relationships.

Page 6: Importance of database design (1)

THE DESIGN PROCESS

Determine the purpose of the database -  This helps prepare for the remaining steps.

Page 7: Importance of database design (1)

Find and organize the information required - Gather all of the types of information to record in the database, such as product name and order number.

Page 8: Importance of database design (1)

Divide the information into tables - Divide information items into major entities or subjects, such as Products or Orders. Each subject then becomes a table.

Page 9: Importance of database design (1)

Turn information items into columns - Decide what information needs to stored in each table. Each item becomes a field, and is displayed as a column in the table. For example, an Employees table might include fields such as Last Name and Hire Date.

Page 10: Importance of database design (1)

Specify primary keys - Choose each table’s primary key. The primary key is a column that is used to uniquely identify each row.

Page 11: Importance of database design (1)

Set up the table relationships - Look at each table and decide how the data in one table is related to the data in other tables. Add fields to tables or create new tables to clarify the relationships, as necessary.

Page 12: Importance of database design (1)

Refine the design - Analyze the design for errors. Create tables and add a few records of sample data. Check if results come from the tables as expected. Make adjustments to the design, as needed.

Page 13: Importance of database design (1)

Apply the normalization rules - Apply the data normalization rules to see if tables are structured correctly. Make adjustments to the tables

Page 14: Importance of database design (1)

THE TABLES

Page 15: Importance of database design (1)

The core table of the database is Incident. This tracks the bulk of information submitting about a particular incident. For example, under injuries there might be multiple parts of the body that were injured. There are several ways to deal with this.

Page 16: Importance of database design (1)

Solution Pros ConsAdd one field for each item

Keeps all the data in one table.

Makes the table extremely large. Adding a new piece of information to be stored means adding an entirely new field. If there are multiple copies of the database in use synchronization becomes extremely difficult. Many database fields will be empty. Poor database design practice. Less efficient database storage.

Allow multiple pieces of data to be entered in each field.

Keeps all the data in one table.

Extremely poor database design practice. Makes querying the database for incidents that meet certain criteria extremely difficult and time consuming.

Create Child Tables

Best practice for database design. Allows for easily adding new types of information. Does not create a "bulky" core table. More efficient for querying the database for incidents that meet certain criteria.

Spreads data out over multiple tables which means that greater database expertise is needed to develop and work with the data.

Page 17: Importance of database design (1)

The recommendation is to create an idb_Incidents Table to handle the information that is discrete (that is can only have one value such as the date of the incident) and create a series of Child tables that store information where there may be multiple pieces of data.

Page 18: Importance of database design (1)

This makes the database much more extendable. If new information needs to be collected, either a new field would be added to the idb_Incidents Table or a new Child table could be created.

Page 19: Importance of database design (1)