Click here to Skip to main content

Design and Architecture

 
GeneralRe: Simple composition - Your thoughts? PinmemberNagy Vilmos15-May-12 1:25 
GeneralRe: Simple composition - Your thoughts? PinprotectorPete O'Hanlon15-May-12 1:56 
GeneralRe: Simple composition - Your thoughts? PinmemberVuNic15-May-12 4:36 
GeneralRe: Simple composition - Your thoughts? PinprotectorPete O'Hanlon15-May-12 4:53 
AnswerRe: Simple composition - Your thoughts? PinmemberBobJanova15-May-12 0:46 
AnswerRe: Simple composition - Your thoughts? PinprotectorMarc Clifton15-May-12 1:51 
GeneralRe: Simple composition - Your thoughts? PinprotectorPete O'Hanlon15-May-12 1:57 
GeneralRe: Simple composition - Your thoughts? PinprotectorMarc Clifton15-May-12 2:45 
GeneralRe: Simple composition - Your thoughts? PinprotectorPete O'Hanlon15-May-12 3:25 
GeneralRe: Simple composition - Your thoughts? PinprotectorMarc Clifton15-May-12 4:57 
GeneralRe: Simple composition - Your thoughts? PinmemberVuNic15-May-12 4:41 
GeneralRe: Simple composition - Your thoughts? PinprotectorMarc Clifton15-May-12 5:06 
GeneralRe: Simple composition - Your thoughts? PinmemberVuNic15-May-12 18:32 
QuestionDatabase Modeling - Conditional Relationships PinmemberLeslie Sanford11-May-12 8:34 
This is probably a really basic database design question, but for some reason, I'm struggling with it.
 
The real world problem I'm trying to solve is a little too escoteric to describe, so I'll try to use a generic example that presents the same problem.
 
Say a store sells two kinds of cogs. Each type of cog is represented in the database with its own table (they have sufficiently different characteristics to warent different table schemas). A customer can buy both kinds of cogs, and we want to keep track of their purchases. So we have a sales table that's associates the customer with the cogs he/she buys. One foreign key points to the customer, and another foreign points to the cog.
 
What's got me stumped is that the foreign key that points to the cog could be associated with either type of cogs. How do we know which? Do we create an additional field that tells us the type of cog the customer purchased? That rings alarms for me in that it's surely unnormalized.
 
So instead do we have seperate sales table for each type of cog? But wouldn't this lead to an explosion of tables as we add more cogs types to our inventory?
 
This must seem like a beginner's question; I'm an old C++ audio programmer who's become a 'web developer', so occasionally I get stumped on DB basics. Any help is appreciated. Smile | :)
AnswerRe: Database Modeling - Conditional Relationships Pinmembermark merrens11-May-12 9:49 
GeneralRe: Database Modeling - Conditional Relationships PinmemberLeslie Sanford12-May-12 8:42 
AnswerRe: Database Modeling - Conditional Relationships PinmemberEddy Vluggen13-May-12 4:32 
AnswerRe: Database Modeling - Conditional Relationships Pinmemberjschell14-May-12 9:24 
Questionhow to design base class? Pinmemberwan.rui@qq.com10-May-12 17:09 
AnswerRe: how to design base class? Pinmemberwalterhevedeich10-May-12 19:29 
AnswerRe: how to design base class? PinprotectorPete O'Hanlon10-May-12 21:52 
GeneralRe: how to design base class? Pinmemberwan.rui@qq.com10-May-12 22:11 
GeneralRe: how to design base class? PinmemberBobJanova15-May-12 0:48 
GeneralRe: how to design base class? Pinmemberwan.rui@qq.com10-May-12 22:15 
GeneralRe: how to design base class? PinmemberTorstenH.15-May-12 0:00 
QuestionActive Directory PinmemberFranklin lloyd10-May-12 7:13 
AnswerRe: Active Directory Pinmemberjschell10-May-12 9:27 
QuestionSingle web solution vs web app + mobile web app Pinmemberlogicaldna8-May-12 22:56 
AnswerRe: Single web solution vs web app + mobile web app PinmemberAniruddha Loya9-May-12 7:34 
GeneralRe: Single web solution vs web app + mobile web app Pinmemberlogicaldna9-May-12 17:22 
SuggestionRe: Single web solution vs web app + mobile web app PinmemberAniruddha Loya10-May-12 10:50 
AnswerRe: Single web solution vs web app + mobile web app PinmemberRobCroll18-May-12 3:23 
QuestionDOC/View/Mainframe or does it matter? PinmemberBarryPearlman8-May-12 11:52 
AnswerRe: DOC/View/Mainframe or does it matter? PinprotectorPete O'Hanlon8-May-12 11:59 
QuestionASP.net Duobt PinmemberSureshBabu S5-May-12 18:29 
AnswerRe: ASP.net Duobt PinmvpOriginalGriff5-May-12 19:30 
AnswerMy vote of 1 PinmentorKeith Barrow5-May-12 23:05 
JokeRe: ASP.net Duobt PinmvpManfred R. Bihy10-May-12 3:44 
QuestionWhat language is this? Pinmembersczii5-May-12 15:15 
AnswerRe: What language is this? PinmemberPrikarna6-May-12 0:25 
GeneralRe: What language is this? Pinmemberjschell7-May-12 8:46 
GeneralRe: What language is this? PinmemberPrikarna10-May-12 0:36 
AnswerRe: What language is this? PinmemberApocalypse Now11-May-12 22:15 
AnswerRe: What language is this? Pinmemberkishhr22-Jun-12 9:06 
Questionproject for you Pinmembersilverbuyer1-May-12 18:43 
QuestionDilemma on exposing methods in interface based programming PinmemberSSEAR22-Apr-12 23:11 
AnswerRe: Dilemma on exposing methods in interface based programming PinmemberVallarasuS24-Apr-12 5:12 
AnswerRe: Dilemma on exposing methods in interface based programming Pinmemberjschell28-Apr-12 7:52 
GeneralRe: Dilemma on exposing methods in interface based programming PinmemberSSEAR29-Apr-12 20:53 
GeneralRe: Dilemma on exposing methods in interface based programming Pinmemberjschell30-Apr-12 8:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 21 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid