Peter, >1. If a column is a primary key, there is no need to declare it a unique. Thank you, I was doing that for every table since I started.
>2. Without foreign keys, your CREATE statements don't reveal table relationships. I am surprised, I thought my SQL is not a proper relationnal database and has no embedded way of specifying the foreign key. For my part I am doing : Have a field in attached table for 1-n relationships Have another table (3) with table1.id and table2.id for n-n relationships What is the proper way then ? >3. The best way I know to validate a schema is to (i) write or draw all the application's use cases, (ii) from the use >cases derive all the required data items, (iii) organise these items into a structure diagram with a modelling tool like >Microsoft Visio or Dezign, (iv) have the modelling tool generate the database, (v) populate the database with a bit of >test data and (vi) see if you can derive (with or without pseudocode) all the system's required outputs. The crucial tests >are step (iv) anf (vi). I have no such program to help design a database, but I have to agree this STEP seems like an optmized way of doing things. I'll try get one such program in the public domain perhaps. Thank you. ps: I still have my SQL dump if you want to have another look.. each time there's a 'simulated' foreign key, it's at the end of the fields and has the nameOfTheTableID naming scheme. For example for displaying a menu, I need to query the tables tgl_item, tgl_course. Since items are classified by course, I've put the simulated foreign key of tgl_course in tgl_item For example when I want to know if a restaurant is open at this time or not, I have all the possible times in tgl_time and the times registered for that restaurant in tgl_rel_rest_time (restID, timeID, weekday) so the three fields of tgl_rel_rest_time form a primary key, but there will be about 300-400 rows for one restaurant.. I don't know if putting a primary key on 3 fields is a good thing to do for speed and storage.. I have no experience in fact. Cheers, Damien -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]