Re: Database efficiency question
Posted by:
Rick James
Date: January 06, 2011 09:11PM
Think of "entities" and "relationships".
A customer is an "entity"; make a table for customers (one row per customer). It would include a unique (PRIMARY KEY) column, say customer_id, plus various bits of data about the customer.
A product is an "entity"; make a table for products.
Then you have a "mapping" or "relationship" between customers and properties. It is probably many-to-many. Make this a table. It would have two imporant columns: customer_id and product_id.
Your queries will often need to do JOINs, maybe even LEFT JOINs. Example: Which product(s), if any, does a given customer have.
Subject
Written By
Posted
Re: Database efficiency question
January 06, 2011 09:11PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.