An Approach to Database Design |
  |
In this General Approach we define the Steps in a structured method to design a Database,
and there
These are the Steps in a Top-Down Approach :-
is another Approach at the bottom of the page.
You can have a look at this Page to see how this Approach applies to the design of a
Database for an HR Department.
The Approach defined here is aimed at beginners and experienced practitioners.
It makes some recommendations to simplify basic design decisions on key structures.
For example, a Customer is a General Entity, and Commercial Customer and Personal Customer
would be Specific Entities.
If you are just starting out, I suggest that you postpone this level of analysis.
For example, "A Customer can place many Orders", and
"A Product can be purchased many times and appear in many Orders."
e.g. "John Doe is a Maintenance Engineer and was born on 1st. August, 1965 and lives at 22 Woodland Street, New Haven.
"He is currently assigned to maintenance of the Air-Conditioning and becomes available in 4 weeks time"
For example, Currency or Country Codes. Where possible, use standard values, such as ISO Codes.
For Reference Tables, use the'Code' as the Key, often with only one other field, which is the Description field.
I recommend that names of Reference Data Tables all start with 'REF_'.
For all non-Reference Data Tables, I suggest that you simply assign an Auto-increment Integer for each Primary Key.
This has some benefits, for example, it provides flexibility, and it's really the only choice for a Database supporting a Web Site.
However, it complicates life for developers, which have to use the natural key to join on, as well
as the 'surrogate' key.
It also makes it possible to postpone a thorough analysis of what the actual Primary Key should be, Which means, of course, that it often never gets done.
e.g. "How many Maintenance Engineers do we have on staff coming available in the next 4 weeks ?"
Development staff, etc. and repeat until the final Database design is reached.
And here's another approach based on the concept of Design Patterns, studying relevant Data Models and
then creating one that meets your requirements.
1) Start by looking at the Student-related Models on this page of the Database Answers web site :-
http://www.databaseanswers.com/data_models/index.htm
2) Identify the Data Model(s) that most closely match your requirements.
3) Choose the Entities that you need (a valuable learning experience)
4) Assemble the corresponding Business Rules
5) Modify the Rules as appropriate.
6) Assemble some Test Data - just 10 or 20 records.
7) Define a typical User Scenario based on the test data.
8) Put 4 pieces of paper on a desk or table -
i) Data MOdels
ii) Business Rules
iii) User Scenarios
iv) Test Data
9) Reflect on them while driving, in the shower, on the bus/train, out walking and so on.
10) Prepare a presentation to show the requirements,(Rules), and the logic of your solution.
11) Let me know how it goes !
Good luck.