[Tutor] DB design

Victor apple_py at biz-experts.net
Fri Feb 18 18:27:24 CET 2005

Liam Clarke wrote:

>>Anyway, why don't you tell us more about what you are trying to do and we can give better suggestions.
>Database organised - 
>Client details ---- Jobs ---- Finances
>                           |                     |
>                           |                     Costs
>                         Resolutions
>It will go by client#/  and job# to reference various bits.
Hi Liam,

I am not a proficient Python nor OO programmer but I know my way around 
databases and SQL. I believe that before you can fully jump into coding 
or even writing SQL queries for your project, you need to get to know 
relational databases lingo and what your subject refers to: DB Design.

Basically you need to organize your data into different tables or 
"entities" and then build relationships around them. You need ot 
identify how each entity relates to each other. Database designers 
usually refer to this as an entity-relationship diagram.

For example, your entity (table) Clients describes certain attributes 
(fields) each one has. The kind of relationship the entity Client can 
have to the entity Jobs is that "one Client can hold one or more Jobs" 
(or in this case "none to many jobs"). So you define the relationship 
between entity Clients and Jobs to be a "none or one-to-many" relationship.

Additionally, there can be "one-to-one" relationships or  "many-to-many" 
(e.g. People to Jobs). I do not know the functionality you want to get 
from your application, but that will take you to define the kind of 
relationships you can build from there.

Schematically this has its own representation, but I prefer to direct 
you to some of the links I just found through googling a little bit. For 
example, look into:

which is very high level. It does not describe the details in the 
lecture, but helps as a first hand intro

More desccriptive, particularly an explanation of what normalization is, 
and how to approach the database design process.

Anybody have any other references or suggestions relating to the subject?

About Python, I assume (experts please jump in) you will build a class 
for each entity, and any record of the entity or table becomes a class 

I hope this helps.

Victor Bouffier
Finance Manager

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050218/5f2d6c1d/attachment.html

More information about the Tutor mailing list