----- Original Message ----- From: "Paul Fine" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 17, 2003 10:37 AM Subject: The correct way to deal with name_1, name_2, name_3
> Greetings, I would be greatful for any advice on the correct way to do this. > > If I have something dynamic, for example customer names where usually there > are 1 or 2 unique customer names but possibly say up to 10, what is the > "correct" design? > > For example I could simply create a table with name_1, name_2, name_3.... > 10. I am sure there is a more efficient way to do this. Could you be more specific? Do you mean one column for each name, in which case these would comprise 10 columns, most of which would have NULL most of the time? Or do you mean a separate row, one of whose columns is customer_name, with one of 10 values? I can't say much because of lack of detail (i.e., what's in the rest of the table), but I'd have TWO tables. In the table you're discussing, I'd have a column called cust_id. In another table, the "customer" table, I'd have two entries, cust_id and cust_name. cust_id in the original table would be a foreign key pointing at the customer table... > Thanks! > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]