Re: Inserting into multiple tables
| From: | Gary | Date: | Mon, 12 Apr 2010 22:00:09 +0000 |
| Subject: | Re: Inserting into multiple tables | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-304012@lists.php.net to get a copy of this message | ||
Tedd
Thanks for your response, perhaps I was completely missing this or my powers
of expanation have gone out the window.
I have found a solution and I am going to put it in its own post.
Thanks again.
gary
"tedd" <tedd.sperling@gmail.com> wrote in message
news:p0624080ac7e9123f4856@[192.168.1.102]...
> At 11:05 AM -0400 4/12/10, Gary wrote:
> -snip-
>>If normalization is so important, why is it that the INSERT INTO multiple
>>tables is not a standard command or procedure?.
>
> In my view, you are mixing apples and oranges.
>
> "Normalization" is simply cutting down on repetition. Inserting data into
> multiple tables is a different critter -- it doesn't make "Normalization"
> any better or worse.
>
> Just figure out what data you need to acquire, what tables you need to
> store it in, and then what references you need to what tables/fields to
> use it while reducing repetition.
>
> For example if you have a customer table, you don't need to add all the
> customer data to each sales receipt (sales table) when you can simply
> record the customer's ID.
>
> Likewise with the items that are sold, you don't need to include all the
> items attributes in the sales receipt (sales table) when you can simply
> record the items' ID.
>
> None of the above requires some special way to inserting data into
> multiple tables -- you just record the sales.
>
> Sales table
>
> Sales ID -- Customer ID -- Item ID -- and probably the date.
> 1234 -- 6789 -- 101112131415 -- 4/12/10
>
> Cheers,
>
> tedd
>
>
> --
> -------
> http://sperling.com http://ancientstones.com
> http://earthstones.com
>
> __________ Information from ESET Smart Security, version of virus
> signature database 5022 (20100412) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
__________ Information from ESET Smart Security, version of virus signature database 5023 (20100412)
__________
The message was checked by ESET Smart Security.
http://www.eset.com