dbTalk Databases Forums  

Relational Modelling Question

comp.databases.theory comp.databases.theory


Discuss Relational Modelling Question in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Daniel Austria
 
Posts: n/a

Default Relational Modelling Question - 04-21-2010 , 11:08 AM






Hi,

i m not sure if i m right in this group, but i think relational
database modelling is a theoretical issue:

I have to following (simplified) situation. I have a company which
sells

- simply one article
- a basket with an amount of the same article
- a customer special bill of material (n articles with amount)

Now the question is: How should i correctly model that with sql on a
relational database?

3 different tables for my products? But than: What should i reference
in the sales document (also a table)?

Constraints:
- It s not allowed to use positions for the basket
- It s not allowed to add a foreign key (to the sales document) to the
article table

In my opinion, this problem is prety much a object orientated
inheritance problem ...


Any help appreciated,
Dan

Reply With Quote
  #2  
Old   
Bob Badour
 
Posts: n/a

Default Re: Relational Modelling Question - 04-21-2010 , 11:11 AM






Daniel Austria wrote:

Quote:
Hi,

i m not sure if i m right in this group, but i think relational
database modelling is a theoretical issue:

I have to following (simplified) situation. I have a company which
sells

- simply one article
- a basket with an amount of the same article
- a customer special bill of material (n articles with amount)

Now the question is: How should i correctly model that with sql on a
relational database?

3 different tables for my products? But than: What should i reference
in the sales document (also a table)?

Constraints:
- It s not allowed to use positions for the basket
- It s not allowed to add a foreign key (to the sales document) to the
article table

In my opinion, this problem is prety much a object orientated
inheritance problem ...

Any help appreciated,
Dan
Sorry, Dan, this is not comp.databases.do.my.homework.for.me

Reply With Quote
  #3  
Old   
Daniel Austria
 
Posts: n/a

Default Re: Relational Modelling Question - 04-21-2010 , 11:38 AM



hi thanks anyway, i found a cool link:
http://jelle.druyts.net/2004/04/14/I...lDatabase.aspx

Reply With Quote
  #4  
Old   
Bob Badour
 
Posts: n/a

Default Re: Relational Modelling Question - 04-21-2010 , 11:50 AM



Daniel Austria wrote:

Quote:
hi thanks anyway, i found a cool link:
I didn't find anything cool about it. I found it very poor in fact.

Reply With Quote
  #5  
Old   
Reinier Post
 
Posts: n/a

Default Re: Relational Modelling Question - 04-22-2010 , 05:36 PM



Daniel Austria wrote:

Quote:
Hi,

i m not sure if i m right in this group, but i think relational
database modelling is a theoretical issue:
Not really. You're not here to discuss theory,
but to apply it.

Quote:
I have to following (simplified) situation. I have a company which
sells

- simply one article
- a basket with an amount of the same article
- a customer special bill of material (n articles with amount)

Now the question is: How should i correctly model that with sql on a
relational database?
One table for the articles.
No table for baskets, as far as I can see.
One table for customers.
One table for orders, with columns referring to customers and articles,
and another column for the amount.
You probably want multiple rows in this table pertaining to the same order.
Not sure whether you want some kind of order number to identify the order,
you may not need that.

Quote:
3 different tables for my products? But than: What should i reference
in the sales document (also a table)?
I think it's a selection from a table: the rows in the orders table that
satisfy certain criteria (having the same order number, or the same
customer and order timestamp, or somethign else, depending on how you
identify them).

Quote:
Constraints:
- It s not allowed to use positions for the basket
- It s not allowed to add a foreign key (to the sales document) to the
article table
Why not?

Quote:
In my opinion, this problem is prety much a object orientated
inheritance problem ...
I don't see how.

--
Reinier

Reply With Quote
  #6  
Old   
Daniel Austria
 
Posts: n/a

Default Re: Relational Modelling Question - 04-23-2010 , 04:43 AM



Hi Reinier,

thanks for your answer. In the meantime i found a complete description
and solution of my problem in

Martin Fowler, Patterns of Enterprise Application Architecture

There is a a chapter Structural Mapping Patterns (41 ff.), which
discusses mapping of compositional hierarchies to relational
databases.

Best,
Dan

Reply With Quote
  #7  
Old   
Bob Badour
 
Posts: n/a

Default Re: Relational Modelling Question - 04-23-2010 , 01:52 PM



Daniel Austria wrote:

Quote:
Hi Reinier,

thanks for your answer. In the meantime i found a complete description
and solution of my problem in

Martin Fowler, Patterns of Enterprise Application Architecture

There is a a chapter Structural Mapping Patterns (41 ff.), which
discusses mapping of compositional hierarchies to relational
databases.

Best,
Dan
Fowler is certainly better than the 1st reference you cited, but I think
you can do a lot better even still.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.