sayedsohail Posted July 16, 2007 Share Posted July 16, 2007 Hi everyone, I am trying to create a table design where i can store predifined titles and the other table to store the contents-service logs under the selected titles. table 1 name:titles Fields: title_id tiny int autoincrement title_desc varchar 45 not null table 2 name: service id int autoincrement car_id int title_id tiny int -> service_desc text date_service date In table 2, most of the times i am storing multiple service logs for the same car i.e, if a car comes for a service in a garrage i am storing multiple records under different titles, i.e, oil filter, engine oil. If a car comes for second service, than i am storing multiple records again under service table, which i can identified by the date. I am not sure if this can be improved, any advise would be greatly appreciated. Thanks for reading. Please note: Sorry this topic is listed in Microsoft Sql and i can't delete or move. Quote Link to comment https://forums.phpfreaks.com/topic/60206-database-design-flaws/ Share on other sites More sharing options...
fenway Posted July 16, 2007 Share Posted July 16, 2007 I don't see anything wrong -- one record per service visit. Quote Link to comment https://forums.phpfreaks.com/topic/60206-database-design-flaws/#findComment-299516 Share on other sites More sharing options...
sayedsohail Posted July 16, 2007 Author Share Posted July 16, 2007 No there will be multiple records for each service i.e., oil filter, engine oil etc. Quote Link to comment https://forums.phpfreaks.com/topic/60206-database-design-flaws/#findComment-299636 Share on other sites More sharing options...
fenway Posted July 16, 2007 Share Posted July 16, 2007 No there will be multiple records for each service i.e., oil filter, engine oil etc. Well, in that case, have another table called service_items. Quote Link to comment https://forums.phpfreaks.com/topic/60206-database-design-flaws/#findComment-299658 Share on other sites More sharing options...
sayedsohail Posted July 16, 2007 Author Share Posted July 16, 2007 service_items, i already got that table as titles, please read the top post. Anyway thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/60206-database-design-flaws/#findComment-299899 Share on other sites More sharing options...
fenway Posted July 17, 2007 Share Posted July 17, 2007 many-to-one is all you need, try to name your tables with something meaningful to everyone. Quote Link to comment https://forums.phpfreaks.com/topic/60206-database-design-flaws/#findComment-300019 Share on other sites More sharing options...
sayedsohail Posted July 17, 2007 Author Share Posted July 17, 2007 Please can you give an example or direct me to some web sources regarding what you are trying to suggest based on this scenario. Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/60206-database-design-flaws/#findComment-300222 Share on other sites More sharing options...
fenway Posted July 17, 2007 Share Posted July 17, 2007 Please can you give an example or direct me to some web sources regarding what you are trying to suggest based on this scenario. Thanks for your help. I'm not sure I understand what you're getting at. Quote Link to comment https://forums.phpfreaks.com/topic/60206-database-design-flaws/#findComment-300322 Share on other sites More sharing options...
sayedsohail Posted July 17, 2007 Author Share Posted July 17, 2007 such a waste of time for you and me, i can't believe after all this, me bad. Quote Link to comment https://forums.phpfreaks.com/topic/60206-database-design-flaws/#findComment-300352 Share on other sites More sharing options...
fenway Posted July 17, 2007 Share Posted July 17, 2007 such a waste of time for you and me, i can't believe after all this, me bad. So very confused... did I miss something? Quote Link to comment https://forums.phpfreaks.com/topic/60206-database-design-flaws/#findComment-300426 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.