Presentation is loading. Please wait.

Presentation is loading. Please wait.

WELL-DESIGNED DATABASES Process faster Easy to develop and maintain Easy to read and write code.

Similar presentations


Presentation on theme: "WELL-DESIGNED DATABASES Process faster Easy to develop and maintain Easy to read and write code."— Presentation transcript:

1 WELL-DESIGNED DATABASES Process faster Easy to develop and maintain Easy to read and write code

2 DATABASE DESIGN PROCESS DETERMINE THE PURPOSE OF THE DATABASE CREATE A MODEL DETERMINE THE TABLES AND FIELDS YOU NEED DETERMINE THE RELATIONSHIPS REFINE YOUR DESIGN

3 DETERMINE THE PURPOSE OF THE DATABASE Start with the output and work backward. What output does the client want to see? What input will be required to produce that output? Describe the screens, the reports, the results that will be produced. Study the existing system. Determine what must be kept, what must be changed and what must be scrapped. Keep this in mind: Any system you deliver must perform at least as well as the system the client is using now.

4 CREATE A MODEL Create a model (drawing, graphic representation, schema) of the data. The model is created with the help of the client. The client knows what needs to be done although he may not know how it will be done - that's your job. Always keep the client involved at the design stage.

5 DEFINITIONS Entity: an object, a thing in the system about which data is kept - equivalent to a file - it will be implemented as a table in the database. (Ex: Student, Professor, Class) Attribute: an item of data refering to an entity - equivalent to a field - it will be implemented as a column in a table in the database. (Ex: Student_Id, Student_Name)

6 DATA MODELING Primary key: the attribute (or combination of attributes) that uniquely identifies every occurence of an entity. (Ex: Student_Id for "Student" entity) Relationship: the way entities link to one another (Ex: Professor teaches Class, Student registered in Class)

7 DATA MODELING The main tool in the modeling process is called an Entity-Relationship diagram or E-R diagram for short. It shows all the components we have been discussing: Entities, Attributes of Entities, Key attributes of Entities and Relationships between Entities.

8 DATA MODELING

9 DEFINING ATTRIBUTES (COLUMNS) Relate each field directly to the subject of the table Don't include derived or calculated data Include all the information you need Store information in its smallest logical parts

10 DEFINING RELATIONSHIPS Normalization: The process of coding relationships in database modeling. Every table must have a primary key The primary key can never contain an empty or Null value. Every attribute of every occurence in the table can contain only one value.

11 REFINE YOUR DESIGN Do you have one table with a large number of fields that don't all relate to the same subject? Do you have fields that are intentionally left blank in many records because they aren't applicable to those records? Do you have a large number of tables, many of which contain the same fields? Are you repeatedly entering duplicate information in one of your tables?


Download ppt "WELL-DESIGNED DATABASES Process faster Easy to develop and maintain Easy to read and write code."

Similar presentations


Ads by Google