Hi All,
I am looking for advice on normalizing a table imported from Excel.
The Excel table lists information on cases that our clients have. Each case can have 1-4 situations. Each situation has three components: a problem, a method, and an outcome. Right now, the Excel table has an individual row for each case. The row also lists info for each problem that the case may have.
It looks like this:
Case#|ProbA|MethodA|OutcomeA|ProbB|MethodB|Outcome B
9000 11A D A 5C D A
9001 4A C B
However, this is quite unwieldy, and breaks normalization rules. I would like to create a junction table of cases and problems that would resemble the following:
Case # | Problem | Method | Outcome
9000 11A D A
9000 5C D A
9001 4A C B
What would be the best way to go about doing this? Would this be through a union query? Maybe the union query would have this idea (please excuse my lack of knowledge of SQL)….
Code:
SELECT cases.ProblemA, cases.MethodA, cases.OutcomeA
UNION cases.ProblemB, cases.MethodB, cases.OutcomeB
UNION cases.ProblemC, cases.MethodC, cases.OutcomeC
UNION cases.ProblemD, cases.MethodD, cases.OutcomeD;
Thank you so much!!!
sarajini