Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The way I learned to work these things out is to stop and make associations.</p> <p>In more object oriented languages (I'm assuming you're using PHP?) that force OO, you learn to think OO very quickly, which is sort of what you're after here.</p> <p>My workflow is like this:</p> <ol> <li>Work out what data you need to store. (Customer name etc.)</li> <li>Work out the main objects you're working with (e.g. Customer, Order, Salesperson etc), and assign each of these a key (e.g. Customer ID).</li> <li>Work out which data connects to which objects. (Customer name belongs to a customer)</li> <li>Work out how the main objects connect to each other (Salesperson sold order to Customer)</li> </ol> <p>Once you have these, you have a good object model of what you're after. The next step is to look at the connections. For example:</p> <ul> <li>Each customer has only one name.</li> <li>Each product can be sold multiple times to anybody</li> <li>Each order has only one salesperson and one customer.</li> </ul> <p>Once you've worked that out, you want to try something called <a href="http://en.wikipedia.org/wiki/Database_normalization" rel="noreferrer" title="Database Normalization - wikipedia">normalization</a>, which is the art of getting this collection of data into a list of tables, still minimizing redundancy. (The idea is, a one-to-one (customer name) is stored in the table with the customer ID, many to one, one to many and many to many are stored in separate tables with certain rules)</p> <p>That's pretty much the gist of it, if you ask for it, I'll scan an example sheet from my workflow for you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload